Closed mynote closed 8 years ago
@mynote is your app signed with the same cert as being used on the sever? Frequently people will swap the release and development certs causing this type of issue.
Yes. It is. This is what i've done (to reproduce).
Created a certificate using this tutorial (http://docs.ionic.io/docs/ios-build-profiles) for Windows.
Means: I created the necessary p12 files. Now i have in the apple developer console: Certificates->Developement->MyName [iOS Development] Identifiers->App IDs->myAppName [id= same as in the app. com.mydomain.myapp] Provisioning Profiles ->Developement->MyProfile [Type=iOS Developement]
At the end i got a Certificate.p12 and MyProfile.mobileprovision which are uploaded to the ionic certificate together with my password.
After this is done i generated a pem for the server: openssl pkcs12 -in Certificate.p12 -out pushcert.pem -nodes -clcerts
the .pem file is used on the server. Am i missing something?
-- Edit while writing.. I was stupid.. Of course there is another certificate required for push.. Working now. Thanks so far!
Hi mynote, I can't make apple notifications work on my ionic 2 app, I generated a development and production certificate, and it's not enough. What did you mean by "another certificate required for push" ?
Even I had the same problem. It was the issue with the payload data that I was sending from the server side. If there is no aps or "content-available": 1 in the JSON format push.on('notification') will not be triggered. Sometimes even the notification appears in the status bar but push.on('notification') the method will not be triggered if you don't have aps or "content-available": 1.
Below is the sample json:
{ "aps": { "alert": "testing", "badge": 1, "sound": "default", "content-available": 1,
"notification": {
"title": "Hi ",
"text": "testing notification"
}
}
}
This thread has been automatically locked.
Expected Behaviour
Push should log the data and show at least a simple push on the Ipad Air 2 Mini
Actual Behaviour
Registration does work but sending a push doesnt. The Server returns a "Delivered Message to APNS". The generated ceritifcate seems to work.
Reproduce Scenario (including but not limited to)
Create a sample Ionic 2 Project (latest version) and add the Plugin + IOS Platform to the app.
After this modify the app.ts with the following content:
Steps to Reproduce
First let the app start and log the registration ID. After this is done use the registration ID to send a Push using a Server-Software.
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
IOS 9.3.1
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
IPAD Air 2 Mini
Cordova CLI version and cordova platform version
Plugin version
Sample Push Data Payload
$tPayload = 'APNS Message Handled by LiveCode'; // Create the message content that is to be sent to the device.
Sample Code that illustrates the problem
Logs taken while reproducing problem
registered – "25d57792be5e76e03e37662b48ce2bf0df6b01a379d1372ce056571e4a30b458"