Push Notifications Not Received

#1

Hi there, I need some help on getdevicePushTokenAsync(). I’m trying to integrate with a third party push server, and I get the token ok, and send it off to the server.

The message seems to send ok from their server - but it’s never received in the app - what could I be doing wrong or what more should I need to do?

0 Likes

#2

Can you provide more information about what you’re doing exactly? Are you detached or in a standalone app? Which platform?

0 Likes

#3

Thanks @jesse !!

I’m in the standalone app via Expo. (I’m trying to detach just now)

I can get the token just fine - it comes through ok. I’m using the updated

getDevicePushTokenAsync(config)

with

    config = {
        gcmSenderId: "********"
    };

I then pass this token to the 3rd party Push Notification server. This PN server already exists and services the current app (we’re developing), to send to APNS and GCM.

The 3rd party server gets the token ok, and the server has been configured with the Server Key to match my Sender ID.

On testing the Push Notification, the feedback is the notification was successfully sent, but no notification appears.

The app is not live on the Play Store, it’s an APK that’s been installed.

Any help would be greatly appreciated as I would really prefer not to eject unless I really have to.

Best
David

0 Likes

#4

@davidbova I’d recommend reaching out to some other people who have used this. See this thread https://github.com/expo/expo/pull/258. This api is hard for us to test and has been mostly maintained by people in the open source community. It looks like you’re doing everything right so I’m not sure exactly what’s going wrong.

0 Likes

#5

Just incase anyone else is interested in this.

I used pushtry.com to push a test push notification. It takes in the device token, a suggested format for the message, and the Server Key (corresponding to the Sender ID you must pass for Android - get this in the FCM console under Settings/Cloud Messaging).

I was able to send a push notification to the app just fine. So this leads me to think there is a problem on the PN server, or the notification message is not in the expected format.

The below is the general suggested format:

{
“to”:“cu0a8cZ_tKA:APA91bF10oBpdRLsHe3RjL9vAKzfj1X0FJSSpw_vOuhPig3w4gcbSR71sL-_goWlbBRXBdYsV2KocU7Fxg-oZJntrs6t0GP566mLMWWXMx1JUxRQB-ueXuxqkGtYjvgsC7azwBin3QA7”,
“notification”:{
“title”:“HALLEJUAH!”,
“body”:""
},
“priority”:“high”}

Works everytime.

0 Likes

closed #6

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

0 Likes