Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

How to Implement Push Notification in iOS ? #124

Closed
Chitranjanbariya opened this issue Sep 11, 2015 · 9 comments
Closed

How to Implement Push Notification in iOS ? #124

Chitranjanbariya opened this issue Sep 11, 2015 · 9 comments
Labels

Comments

@Chitranjanbariya
Copy link

Please give me a step of How to create in IOS. How i put apns app id in this.
please help me.....

@macdonst
Copy link
Member

@Chitranjanbariya on iOS you don't need to send the apns app id as part of the options. You just need to make sure your iOS certificate is setup correctly. There is a good tutorial over here:

http://code.tutsplus.com/tutorials/setting-up-push-notifications-on-ios--cms-21925

@leonardopaiva
Copy link

thanks @macdonst the tutorial helped alot

@leonardopaiva
Copy link

@Chitranjanbariya i`m just starting with push notification, this is my experience so far:

you can use the tutorial that @macdonst spoke http://code.tutsplus.com/tutorials/setting-up-push-notifications-on-ios--cms-21925
you will use step 1 then 4 to 6, you can jump step 2 and 3 (thats what worked for me)

you can use this tutorial too: http://www.apptuitions.com/generate-pem-file-for-push-notification/
since it covers the part where you need to generate the "pushcert.pem" file, when you have the pushcert.pem file you can send the push using this:
https://github.com/phonegap/phonegap-plugin-push/blob/master/example/server/pushAPNS.rb
or with php using this https://github.com/GustavoCostaW/PushNotificationBackendSamples/blob/master/ios.php
(i used the last one)

this line will have the .pem file directory:
"stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem');"
so replace by "pushcert.pem" and put the pushcert.pem file on same directory from your server file:
"stream_context_set_option($ctx, 'ssl', 'local_cert', 'pushcert.pem');"

$passphrase = the .pem file password (step 8 from the last tutorial)

@colonna-mike
Copy link

Hello,
Are you saying the pem file does not have to part of the phone build but on the PHP server side ( in my case). So on the app side nothing is needed to get the IPhone id correct?.

@leonardopaiva
Copy link

@colonna-mike yes... but i`m not sure about that, because i haven't made tests on a production app, only on development using a localhost server.

@macdonst can you aswer this question?

@fredgalvao
Copy link
Collaborator

The only thing needed on the app itself for push notifications to work on iOS is to sign it with proper certificates and provisioning profiles, generated with a valid push notification certificate. The pem/key files need only to go on the server, you'll need to feed them to the APNS api to send notifications.

@leonardopaiva
Copy link

thanks @fredgalvao

@ghost
Copy link

ghost commented Sep 24, 2015

Hi Guys,

I've configured the APNS certificate for iOS and obtained the GCM API KEY and SENDER ID for iOS (are the same of Android) the issue is that the notifications arrives in android devices but not in iOS.

during the debugging of my server implementation with GCM I can see that the issue seems to be with the following error: "invalidRegistration" (from GCM) but the register id seems to be correct, can this issue be related with the APNS certificate configuration in XCode?

Any help will be appreciated a lot!

Best regards

@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

5 participants