I am sending push-notification to i-phone using Java APNs. Am able to send notification to one app but am not able to send notification to other apps. For first app (Successful sending push notification) am using
String json1= "{\"aps\":{\"alert\":\"Testing.. (3)\",\"badge\":1,\"sound\":\"default\"}}";
PushNotificationPayload payLoad = null;
try {
payLoad = PushNotificationPayload.fromJSON(json1);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Push.payload(payLoad , "/home/owner/Downloads/v.p12", null, false, "97884fe9ffeb6f5....");
and for other app (unsuccessful) am using the same
String json1= "{\"aps\":{\"alert\":\"Testing.. (3)\",\"badge\":1,\"sound\":\"default\"}}";
PushNotificationPayload payLoad = null;
try {
payLoad = PushNotificationPayload.fromJSON(json1);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Push.payload(payLoad , "/home/owner/Downloads/app.p12", null, false, "191cdc5a8c8c1cb19597a4fd....");
any help ??
I found one solution to my problem. am not sure if it is the correct way or not.
Create .p12 or .pem using your .cert file from the keychain for app1.
clean the keychain store(where all your .cert file exist).
download the .cert for app2.
generate the .p12 or .pem for app2.
now I can successfully send notification on both the apps on same device.