PushSharp version : Version 2.2.1
Issue Description
I am using pushsharp to send push notifications to windows phone app 8.1.
I installed the app on a windows phone and got a channel URI. Using the same channel URI the push notification worked for me.
Then I uninstalled and installed the app again on the windows phone. This gave me an updated Channel URI.
Using the updated channel URI, the push notification fails with the error:"Device Subscription Expired:
PushSharp.Windows.WindowsPushService -> <>"
Kindly let me know is there something that I am doing wrong because of which the notification fails after reinstalling the app
(i.e. with new channel URI).
Sample Code
push.RegisterWindowsService(new WindowsPushChannelSettings("package name", "package security identifier", "client secret")); push.QueueNotification(new WindowsToastNotification() .AsToastText01("This is a test notification") .ForChannelUri("https://db5.notify.windows.com/?token=AwYAAADhaxGQuJHxAGCdCOJa+kyrZ012wjF19Zm+VfriKZVxKqM3Dt4kQz9t6EllMZHgiA4oE1uvij2wdiTwItmp7UUnGoAPp3hc9FnLkJqpckt1xQAux/wez++MVGaty0QKRNk="));
Exception
"Device Subscription Expired: PushSharp.Windows.WindowsPushService -> new channel URI"
Resolved the issue. The device token was getting url decoded while transmitting from angular UI to pushsharp app. Encoding again helped to gain the actual channel URI.
System.Web.HttpUtility.UrlEncode(DeviceToken);
Related
Does anyone facing issue with fcm to delivery push notification with HTTP v1?
I've an scenario in which I'm having strange issue. When I'm running an debug build or release build in my mobile, I'm able to receive push notification in device with high priority but when I'm sending push notification to those users who have downloaded same build from play store, they're not receiving push notification on device side.
While I'm not getting any error response from fcm service https://fcm.googleapis.com/.../projects/messages:send when sending push notification to client who have downloaded from play store. While using same API, it's delivering push to client's device who've installed direct .apk file.
Can anyone have an idea or might have faced similar issue in past?
I have my XMPP server which was working with GCM. I upgraded to FCM as per google says though I am able to receive notifications from FCM notification console, not able to receive any upstream messages with FireBaseMessaging.send() ... If any one has done this migration please help.
Note : I have a XMPP server which was working and able to receive upstream messages via GCM. (After migration to FCM it is not receiving any messages even though the end points are changed. Am i missing anything from docs)
This is fixed ! while using both (GCM, FCM) dependency in my project I was using a string resource default-project_id from GCM dependency. I now removed and replaced that with the project_id and it is fixed. So endpoint change is not mandatory.
Make sure you update the server endpoints. Note that the new FCM version of gcm-http.googleapis.com/gcm/ is fcm.googleapis.com/fcm/ (without "http"):
Change GCM endpoint
gcm-xmpp.googleapis.com
to FCM endpoint
fcm-xmpp.googleapis.com
source: Migrate a GCM Client App for Android to Firebase Cloud Messaging
For more information, Check this Upstream message syntax for FCM and how to send Upstream messages on Android.
My setup include a webapp, a backend server and an android app.
I want to be able to chat between my android app and webapp.
Init:
Android app has subscribed to the topic /topics/chatGroupName
Similarly on browser, I get the registrationToken and send it to my server where I use code similar in https://github.com/ToothlessGear/node-gcm/pull/211/files (addToTopicNoRetry) to subscribe the browser to the topic: /topics/chatGroupName
When I send a message from the web, I use my backend server to send a GCM message on a topic like /topics/chatGroupName and the android app receives this message.
But when I send GCM message from Android app on this topic /topics/chatGroupName, I dont get any notification on the browser app.
Even my https://iid.googleapis.com/iid/info/REGISTRATION_TOKEN?details=true shows that this registration token has already subscribed to /topics/chatGroupName
Firebase has now released javascript library that supports FCM push notifications with support for topics.
Ref: https://firebase.google.com/docs/cloud-messaging/js/client
No I started use push notification in my project (it worked sometime ago), but can't make it work. I downloade sample-messages project and changed my account and application settings. But messaged don't delivered to receiver. Registration of device is ok. I see my subscribtion. No errors from response when sending notification. What I only got is the json description from logs, when i click my message from queue (but it's in status "sent") Can't get it work. Please, help.
{"notification":{"registration_ids":["APA91bEsqEY2OcaQpgU6Nmk6P7P0fSEdnGuXHSOnUwMJ3ZCAuZC0hGiE_7DX-TlvuAnivJ3Bt4nSM7eEN3AR2Qg2jjCGC8RRT7GbDJgpuy25plCohb23CpD5hLaHo7l-TZvgZhpXjCM0"],"delay_while_idle":false,"data":{"message":"fgjkkkkllkleddxccvvvcxfffffjhghvfg I was ","collapse_key":"event5711312"},"time_to_live":86400},"log":[{"device_token":null,"created_at":"2016-02-23T18:21:42Z","delivered_at":null,"failed_at":"2016-02-23T18:21:47Z","error_code":401,"error_description":"Unable to deliver notification 11778569, received error 401 (Unauthorized, check your App auth_key.)"}]}
I redid all the configuration steps in the link:http://quickblox.com/developers/SimpleSample-messages_users-android#Setup_GCM
Now it is back to work!
Attention to some details:
The API key you have to use in Google cloud console is of the SERVER type
Use the same package name on Android manifest and Google cloud console
Use your application ID from developer console to get GCM token on your Android application
don't forget to copy the google-services.json (generated when you enabled Google services for your app) to app/ directory on your project (the same directory of your src/)
I am working with AWS SNS Implementation in My iOS app and I followed all SNS documentation to create platform in SNS Dashboard.
I am getting an error like "Invalid parameter: Attributes Reason: Platform credentials are invalid " When creating new platform application and please anyone guide me to sort this issue.
Amazon SNS differentiates between the production (APNS) and development (APNS_SANDBOX) versions of apple's push notification services. The error you are encountering is typical to developers accidentally attempting to create an APNS platform application with APNS_SANDBOX credentials, or vice-versa. Can you confirm whether you are using the correct set of credentials for the given platform?
Regards,
-Sid
For people who are configuring Apple Push Notification in AWS Mobile Hub, remember it now (since late 2015) has simplified the APNS certificate to take a single Universal (Production + Sandbox) certificate, so when you generate APNS certificate, remember to choose Sandbox & Production:
and upload the generated .p12 file to AWS.