-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Send to GCM Topic on iOS not received #440
Comments
I've tested on android and ios. Android works everything just fine. On iOs a receive the registration id but can't send a push notification, invalid registration. |
@jesercm what does your registration ID look like? |
Looks like this: |
@jesercm and you get that from the registration event? Can I see the parameters you pass to init? |
var push = PushNotification.init({
|
@jesercm you are not using GCM on iOS. You are missing a couple of parameters in your init method. Look at Also, once you get the proper registration ID you still won't be able to receive topic messages. Just regular pushes to the reg ID. |
@macdonst I have added the senderID on ios, then i get another registration ID, just like i get on android. But still cant receive messages. What you mean with regular pushes and topic messages? |
Hi, it seems that this is caused by the branch with the topic code (https://github.com/phonegap/phonegap-plugin-push/tree/issue79) not being merged into master. I tried that in my local repo and notifications are working fine. |
@bardu it has nothing to do with the branch @glecaros mentioned. That is to fix the issue where topic messages are not received by GCM iOS. Please make sure you do the following:
|
@macdonst Thanks for your response.
Maybe I wasn't clear but this is my issue too.
However, on('notification',..) is not firing. All works fine with Android. Just in case here are my init options: var topics = _getTopics();
var push = PushNotification.init({
android: {
senderID: app.config.gcm.senderID,
topics: topics
},
ios: {
senderID: app.config.gcm.senderID,
gcmSandbox: "true",
alert: "true",
badge: "true",
sound: "true",
vibration: "true",
topics: topics
}
}); |
@bardu right GCM topic messages on iOS are not working currently. |
Well, that brings me back to my original question:
|
@bardu well I can do the merge of that branch but I've never successfully received a topic notification on iOS running that code so I'd like to look into it some more. |
@macdonst makes sense, has this bug a high priority for you? Right now it is quite a showstopper for our app. |
My code uses: This should work for both Android and iOS sending a simple message? On my tests this works for Android. When i run my app on iOS i get a registration ID just like the same format on android, but when i try to send the push notification, only on Android is sent. I get Invalid Registration. I double checked the registration id that i get from iOS but nothing changes. |
@bardu this is an open source project so is you pull from the @jesercm did you upload your APNS certs to your Google project? |
@macdonst Where do i upload the certs? |
@macdonst I pulled from issue79 branch and can confirm that the notification is send to iOS devices (iPhone 6 iOS v9.2, iPhone 5 iOS v9.1) however there is no sound, vibration and badge. |
@bardu so you send a push to a GCM topic and it gets to your iOS device? |
@macdonst yes |
@macdonst There is another issue: While on Android the device receives the notification ones, on iOS multiple times. Hope this console output from iOS can offer some hints:
|
@macdonst I did have uploaded the p12 files. Do i need to use GoogleService-Info.plist for something? |
@macdonst Please ignore my last post. The multiple notifications sent to iOS was a bug on my app server. @jesercm Yes, you need to drag and drop it into your cordova project. I usually put it into Then open Xcode by double clicking .xcworkspace. in Xcode Project Build Phases in Xcode Build Settings (only if build error: Undefined symbols for architecture arm64:) From here on the project should build in Xcode. If you get a build error in Codova CLI such as error: Ld build/device/YourProject.app/YourProject normal armv7 |
@bardu There is a way to use it on Phonegap Build? |
@jesercm it builds with Cordova, but you have to do the steps in Xcode to add GoogleService-Info.plist. I don't use Phonegap Build. |
@bardu that's what I'm working on. Automatically adding the info in GoogleService-Info.plist into the project when you add the plugin. |
@macdonst Did you have a chance to test issue79 branch again? It works for me on iPhone5, 6, except sound, vibration, badge but this branch is 18 commits behind master. |
Awesome! Would make life much easier. |
@bardu can you pull the code from
Where the XXXX is your GCM_SENDER_ID and YYYY is the GOOGLE_APP_ID from the GoogleService-Info.plist. Also, please make sure that the plist is not in your project anymore. |
@macdonst This means that we will be able to use something like below when merged into master for PGB? <plugin name="phonegap-plugin-push">
<param name="SENDER_ID" value="xxxx" />
<param name="GOOGLE_APP_ID" value="yyyy" />
</plugin> |
@jesercm correct! |
@macdonst That is awesome. Congrats for this! |
@jesercm don't congratulate me yet. I'm not 100% sure that it works 😃 |
@macdonst The iniciative works 😄 |
What?
|
@macdonst Your iniciative to make this plugin, its good. |
@macdonst Just want to let you know that I'm testing code from issue79, however, I run into some issues and try to figure out the root. Will response again later the day. |
@macdonst Here is what I have done so far and the issues:
Sending GCM topics to iOS works on my iPhone 6, 5 both with iOS 9.2, however, there are no sound, vibration and badge. Now, I updated iOS platform to latest version
and get the following build error:
and
I have an issue on Android too, but need to go on a Linux box since my iMac doesn't recognize my Samsung S6. Later more. |
That first issue on iOS compilation is caused by a known cordova-ios issue, nothing related to this plugin. See here for details. |
@fredgalvao Thanks. Just reverted to 3.9.2 to focus on the plugin. @macdonst So, as I mentioned earlier works for me on iOS but there is no sound, vibration and badge. The Android issue I mentioned above was not related to this plugin. |
@bardu so just to confirm, when you use the |
@macdonst yes, I do. |
@bardu awesome, I'll merge this into master soonish. |
@macdonst I can confirm that issue79 branch (merged in 1.5.3 in my fork) fixes this for me as well, +1 great work! Probably not valuable now but I could not see the registered topic in the iid prior to the merge, but evidently it was present when working, after the merge. (when querying https://iid.googleapis.com/iid/info/?&details=true) |
@bardu yes, it's in master now. |
I'm still not receiving it on IOS when I'm using topics array. I'm getting the notification if I'm sending it with device id. and my js code is: I also have this feeling that I'm not using the version of code with the merged branch (issue79). Though I do not know how to check on that. |
@Gnaneshwar511 - I was trying with an app i had created with the step by step from [http://macdonst.github.io/push-workshop/](this was not covering ios) I also had a similar issue where I was getting topic notifications correctly in Android but Not in Ios . When I send notificatinos to direct Device Id's from FCM console as well as POST (with PostMan Chrome Plugin) - I was getting these notifications delivered suceesfully
(GOOGLE_APP_ID - I copied from GoogleService-Info.plist downloaded from FCM console) |
Hi guys, I'am the same issue on iOs(everything is ok on Android). I'am using the latest version (1.9.0) on the master branch.
Here what can i see in xcode console:
First i didn't set the GOOGLE_APP_ID (didn't find anything in the doc about it, maybe i missed it). |
This thread has been automatically locked. |
The iOS implementation allows you to subscribe to topics but when you send to the topic the message is not received.
The text was updated successfully, but these errors were encountered: