Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Anyone got Parse pushes working in a XF Android app when app has been closed?

$
0
0

I have Parse pushes working for all states (foreground/background/closed) on iOS, but on Android it only works when the app is in the foreground or background. If I receive a push after the user has closed the app, my app is loaded briefly and then crashes. It looks to me that the Parse dll is the culprit, but I'm not sure.

Here's an edited excerpt from the logcat

I/GCM GCM message com.someplusone.pt 0:1434508367071102%29828106f9fd7ecd I/ActivityManager( 758): Start proc 14125:com.someplusone.pt/u0a378 for broadcast com.someplusone.pt/parse.ParsePushBroadcastReceiver
broadcast intent callback result=CANCELLED forIntent act=com.google.android.c2dm.intent.RECEIVE pkg=com.someplusone.pt (has extras)
UNHANDLED EXCEPTION:
System.InvalidCastException: Cannot cast from source type to destination type.
at (wrapper castclass) object.__castclass_with_cache (object,intptr,intptr)
at Parse.ParseObject.CreateWithoutData<Parse.ParseInstallation> (string)

AndroidManifest
uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"
uses-permission android:name="android.permission.VIBRATE"
uses-permission android:name="android.permission.INTERNET"
uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
uses-permission android:name="android.permission.WAKE_LOCK"
uses-permission android:name="android.permission.GET_ACCOUNTS"
uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"
permission android:protectionLevel="signature" android:name="com.someplusone.pt.permission.C2D_MESSAGE"
uses-permission android:name="com.someplusone.pt.permission.C2D_MESSAGE"
uses-permission android:name="android.permission.READ_CONTACTS"
application android:label="PT" android:icon="@drawable/icon"
service android:name="parse.ParsePushService"
receiver android:name="parse.ParsePushBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"
intent-filter
action android:name="android.intent.action.BOOT_COMPLETED"
action android:name="com.google.android.c2dm.intent.RECEIVE"
action android:name="com.google.android.c2dm.intent.REGISTRATION"
category android:name="com.someplusone.pt"
intent-filter
receiver
application

I've tested the Parse sample app, and it doesn't crash when a push arrives and the app has been closed... but their sample is not a Forms app.
I've used a Xamarin supplied Forms template. Testing on a physical Android Nexus 5.
I would appreciate anyone letting me know if they have a Forms app that doesn't crash, or a tip to why my app crashes.

Cheers

@ListiarsoWastuargo @BugMaN @crossplatformer @Garnish


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>