Onesignal-android-sdk: Don't open web browser when clicked into notification

Created on 9 Oct 2017  路  2Comments  路  Source: OneSignal/OneSignal-Android-SDK

I set launchUrl in notification, but it's don't open web browser when click into notification. I'm debug and see that this line in OneSignal class return true:

boolean defaultOpenActionDisabled = "DISABLE".equals(OSUtils.getManifestMeta(inContext, "com.onesignal.NotificationOpened.DEFAULT"));

So that, method openURLFromNotification not called.

What's wrong here? How can i fix it? Have any ideal for my problem?

Question

Most helpful comment

@sinhpn92 It looks like you have indicated through your manifest placeholders that you want OneSignal to handle an open event with the default behavior (open your launcher Activity) as referenced here: https://documentation.onesignal.com/docs/android-customizations#section-changing-the-open-action-of-a-notification

Remove the <meta-data android:name="com.onesignal.NotificationOpened.DEFAULT" android:value="DISABLE" /> from your AndroidManifest.xml and your URL should open properly

All 2 comments

@sinhpn92 It looks like you have indicated through your manifest placeholders that you want OneSignal to handle an open event with the default behavior (open your launcher Activity) as referenced here: https://documentation.onesignal.com/docs/android-customizations#section-changing-the-open-action-of-a-notification

Remove the <meta-data android:name="com.onesignal.NotificationOpened.DEFAULT" android:value="DISABLE" /> from your AndroidManifest.xml and your URL should open properly

@sinhpn92 Feel free to reply if the above answer did not help

Was this page helpful?
0 / 5 - 0 ratings