I am able to receive notification properly in my android app,
However, The behavior is unexpected while clicking on notification which belongs to deeplink it opening the ParsedeeplinkActivity but after parsing and navigating to desired activity it relaunch the app and it lands to default app page(SplashScreen) means it doesn't work as a deeplink,It just opening the app.
If i uncomment the setAutoLaunchApplication(false) of createAirshipConfigOptions() then deeplink is working fine but the problem is when i am sending notification as a Home tag from UA dashboard and clicking on notification nothing happens even it's not opening the app for Home.
given below the createAirshipConfigOptions() of Autopilet class and onNotificationOpened() of AirshipReceiver class
public AirshipConfigOptions createAirshipConfigOptions(@NonNull Context context) {
AirshipConfigOptions options = new AirshipConfigOptions.Builder()
.setDevelopmentAppKey("xxxxxxxxxxxxxxxxxxxx")
.setDevelopmentAppSecret("xxxxxxxxxxxxxxxxxxx")
.setProductionAppKey("xxxxxxxxxxxxxxxxxxxxxxx")
.setProductionAppSecret("xxxxxxxxxxxxxxxxxxxx")
.setProductionLogLevel(Log.VERBOSE)
.setFcmSenderId("xxxxxxxxxxxxx") // FCM/GCM sender ID
.setNotificationIcon(R.drawable.abc)
// .setAutoLaunchApplication(false)
.build();
return options;
}
@Override
protected boolean onNotificationOpened( Context context, NotificationInfo notificationInfo) {
LogUtils.debugLog(TAG, "Notification opened. Alert: " + notificationInfo.getMessage().getAlert() + ". NotificationId: " + notificationInfo.getNotificationId());
String actionsPayload = notificationInfo.getMessage().getActions().toString();
if(actionsPayload.contains("{}"))
return true;
else
return false;
}
@Override
protected boolean onNotificationOpened( Context context, NotificationInfo notificationInfo, ActionButtonInfo actionButtonInfo) {
LogUtils.debugLog(TAG, "Notification action button opened. Button ID: " + actionButtonInfo.getButtonId() + ". NotificationId: " + notificationInfo.getNotificationId());
String actionsPayload = notificationInfo.getMessage().getActions().toString();
if(actionsPayload.contains("{}"))
return true;
else
return false;
}
Could you guys please suggest if anything i missed from my side.?
Comments
1 comment