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
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'pahansith/device-mgt-core:fcm-fix'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Fixes: https://roadmap.entgra.net/issues/11363
public void undeploy() {
}
private void sendWakeUpCall(String accessToken, String registrationId) throws IOException,
Add Java Doc comment
}
private void sendWakeUpCall(String accessToken, String registrationId) throws IOException,
PushNotificationExecutionFailedException {
OutputStream os = null;
Since this is extend with the Closable Interface, we can wrap 'OutputStream' part with try-with-resources.
HttpURLConnection conn = null;
String fcmServerEndpoint = FCMUtil.getInstance().getContextMetadataProperties().getProperty(FCM_ENDPOINT_KEY);
if(fcmServerEndpoint == null) {
Fix formatting issue
data.addProperty("data", message);
fcmRequest.add("data", data);
}
private static String getFCMRequest(String registrationId) {
Add Java Doc comment
fromStream(Files.newInputStream(serviceAccountPath)).
createScoped(FCM_SCOPES);
} catch (IOException e) {
log.error("Fail to initialize default OAuth application for FCM communication");
Log and throw with the error message
}
}
private void initContextConfigs() {
Add Java Doc comment
contextMetadataProperties = properties;
}
public static FCMUtil getInstance() {
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.
<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>
Move version number into properties section and get it from there.
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>1.20.0</version>
Move version number into properties section and get it from there.
3b672c74b4
into master 5 months agoReviewers
3b672c74b4
.