CrossGeeks / FirebasePushNotificationPlugin

Firebase Push Notification Plugin for Xamarin iOS and Android
MIT License
394 stars 177 forks source link

Crash when Release on Android #92

Closed Marsgames closed 6 years ago

Marsgames commented 6 years ago

Bug Information

Version Number of Plugin: 2.1.3 Device Tested On: Samsung SM-N910F API 23 (Galaxy Note 4) Version of VS: 7.3.3 build 5 Version of Xamarin: 2.5.0.122203

Steps to reproduce the Behavior

Run application on device in release

Expected Behavior

Application work

Actual Behavior

Application crash

Code snippet

https://gist.github.com/Marsgames/acb3ccb1aff10576bf840b84e96a8caa https://gist.github.com/Marsgames/2e7cfa83c2f61209b4ba4a5ff317300a

Screenshots

screenshot_2018-01-15-11-27-15

Marsgames commented 6 years ago

Seams to work if I remove bin and obj folder and clean solution.

Now I'm not able to receive any notification on android even in debug. google-services ok, I'm registered in topics but don't receive any notification on topics or directly using token. Nothing happen.

rdelrosario commented 6 years ago

Ok Could you send me your AndroidManifest to check if is configured correctly?

Marsgames commented 6 years ago

For sure

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" package="koders.airria" android:installLocation="preferExternal" android:versionCode="3">
        <uses-sdk android:minSdkVersion="15" />
        <uses-permission android:name="android.permission.INTERNET" />
        <application android:label="Airria" android:icon="@drawable/airrialogo">
        </application>
        <receiver android:name="localnotifications.plugin.ScheduledAlarmHandler" android:enabled="true">
        </receiver>
        <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
        <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
                <intent-filter>
                        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                        <category android:name="${applicationId}" />
                </intent-filter>
        </receiver>
</manifest>
rdelrosario commented 6 years ago

Should be:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" package="koders.airria" android:installLocation="preferExternal" android:versionCode="3">
        <uses-sdk android:minSdkVersion="15" />
        <uses-permission android:name="android.permission.INTERNET" />
        <application android:label="Airria" android:icon="@drawable/airrialogo">
             <receiver android:name="localnotifications.plugin.ScheduledAlarmHandler" android:enabled="true">
             </receiver>
            <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
           <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
                <intent-filter>
                        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                        <category android:name="${applicationId}" />
                </intent-filter>
           </receiver>
        </application>
</manifest>
Marsgames commented 6 years ago

Thank you so much, it works perfectly now. You and your plugin are the best ;)