OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

Tapping notification opens in Browser on Amazon Fire HD 8 #111

Closed EmilAlipiev closed 6 years ago

EmilAlipiev commented 6 years ago

Description: I went through the Amazon implementation and enabled amazon on the one signal dashboard. everything seems to be working fine. I can send the notification and my amazon fire hd 8 device receives it but once I tap on the notification, default browser opens a blank page.

(your description here)

Environment

here is how my manifest looks like


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:amazon="http://schemas.amazon.com/apk/res/android" package="myApp.myApp"
          android:versionName="1.1.7" android:installLocation="preferExternal" android:versionCode="15">
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
    <uses-permission android:name="android.permission.READ_LOGS" />
    <uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" /> 
    <uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
    <permission android:name="myApp.myApp.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="myApp.myApp.permission.RECEIVE_ADM_MESSAGE" />
    <application android:largeHeap="true" android:label="myApp"  android:theme="@style/MyTheme" android:icon="@drawable/icon">  
        <meta-data android:name="onesignal_app_id" android:value="xxxxxxx" />
        <meta-data android:name="onesignal_google_project_number" android:value="xxxxxx" />
        <meta-data android:name="com.onesignal.NotificationAccentColor.DEFAULT" android:value="#2196F3" />
        <!--<receiver android:name="com.onesignal.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="myApp.myApp" />
            </intent-filter>
        </receiver>-->
        <receiver android:name="com.onesignal.NotificationOpenedReceiver" />
        <service android:name="com.onesignal.GcmIntentService" />
        <service android:name="com.onesignal.SyncService" android:stopWithTask="false" />
        <activity android:name="com.onesignal.PermissionsActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
        <receiver android:name="com.amazon.device.iap.ResponseReceiver">
            <intent-filter>
                <action android:name="com.amazon.inapp.purchasing.NOTIFY" android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY" />
            </intent-filter>
        </receiver>
        <amazon:enable-feature android:name="com.amazon.device.messaging" android:required="false" />
        <!-- Warnings about " is not assignable" can be safely ignored. -->
        <service android:name="com.onesignal.ADMMessageHandler" android:exported="false" />
        <receiver android:name="com.onesignal.ADMMessageHandler$Receiver" android:permission="com.amazon.device.messaging.permission.SEND">
            <intent-filter>
                <action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
                <action android:name="com.amazon.device.messaging.intent.RECEIVE" />
                <category android:name="myApp.myApp" />
            </intent-filter>
        </receiver>
    </application>
</manifest>

this is how i initialize onesignal in the mainactivity

 private void getOneSignal()
        {

            //// Initialize OneSignal
            OneSignal.Current.StartInit("xxxxxxxxxxxxxxxxxxxxxxxx")
              .InFocusDisplaying(OSInFocusDisplayOption.Notification)
              .HandleNotificationOpened((result) => {
                  try
                  {

                    // do something
                  }
                  catch (System.Exception e)
                  {

                  }
              })
              .EndInit();

            OneSignal.Current.IdsAvailable((playerID, pushToken) =>
            {
                App.OneSignalPlayerId = playerID;
            });
        }

that code works fine on Google devices but not amazon.

jkasten2 commented 6 years ago

@EmilAlipiev Sorry for the delay , this was an issue with OneSignal sending an incorrect payload ADM payload to FireOS devices. This has already been corrected. Thanks.