Migrate from legacy FCM APIs to HTTP v1 #426

Merged
tcdlpds merged 6 commits from pahansith/device-mgt-core:fcm-fix into master 5 months ago
Owner
There is no content yet.
pahansith added 4 commits 5 months ago
Poster
Owner
Fixes: https://roadmap.entgra.net/issues/11363
tcdlpds requested changes 5 months ago
public void undeploy() {
}
private void sendWakeUpCall(String accessToken, String registrationId) throws IOException,
Owner

Add Java Doc comment

Add Java Doc comment
pahansith marked this conversation as resolved
}
private void sendWakeUpCall(String accessToken, String registrationId) throws IOException,
PushNotificationExecutionFailedException {
OutputStream os = null;
Owner

Since this is extend with the Closable Interface, we can wrap 'OutputStream' part with try-with-resources.

Since this is extend with the Closable Interface, we can wrap 'OutputStream' part with try-with-resources.
pahansith marked this conversation as resolved
HttpURLConnection conn = null;
String fcmServerEndpoint = FCMUtil.getInstance().getContextMetadataProperties().getProperty(FCM_ENDPOINT_KEY);
if(fcmServerEndpoint == null) {
Owner

Fix formatting issue

Fix formatting issue
pahansith marked this conversation as resolved
data.addProperty("data", message);
fcmRequest.add("data", data);
}
private static String getFCMRequest(String registrationId) {
Owner

Add Java Doc comment

Add Java Doc comment
pahansith marked this conversation as resolved
fromStream(Files.newInputStream(serviceAccountPath)).
createScoped(FCM_SCOPES);
} catch (IOException e) {
log.error("Fail to initialize default OAuth application for FCM communication");
Owner

Log and throw with the error message

Log and throw with the error message
pahansith marked this conversation as resolved
}
}
private void initContextConfigs() {
Owner

Add Java Doc comment

Add Java Doc comment
pahansith marked this conversation as resolved
contextMetadataProperties = properties;
}
public static FCMUtil getInstance() {
Owner

Add Java doc comment, mentioning Singleton patter and the requirement of it. It will be helpful to someone who refer this code in the future.

Add Java doc comment, mentioning Singleton patter and the requirement of it. It will be helpful to someone who refer this code in the future.
pahansith marked this conversation as resolved
pom.xml Outdated
<dependency>
<groupId>org.wso2.orbit.com.google.auth-library-oauth2-http</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>1.20.0.wso2v1</version>
Owner

Move version number into properties section and get it from there.

Move version number into properties section and get it from there.
pahansith marked this conversation as resolved
pom.xml Outdated
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>1.20.0</version>
Owner

Move version number into properties section and get it from there.

Move version number into properties section and get it from there.
pahansith marked this conversation as resolved
pahansith added 1 commit 5 months ago
pahansith added 1 commit 5 months ago
tcdlpds merged commit 3b672c74b4 into master 5 months ago

Reviewers

tcdlpds requested changes 5 months ago
The pull request has been merged as 3b672c74b4.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: community/device-mgt-core#426
Loading…
There is no content yet.