RE: Error sending Apple iOS Push Notifications

thumbnail
Denis Signoretto, modified 8 Years ago. Expert Posts: 375 Join Date: 4/21/09 Recent Posts
Hi,

I'm using Liferay 6.2 CE GA6 and Liferay Push CE Notification portlet 1.3.0. I can successfully register iOS devices and the list of available push tokens is correctly populated in Liferay Push CE portlet. I've configured Apple APN certificate, password and sandbox mode through control panel.

Selecting sanbox certificate and sanbox flag all is working fine. Switching to production mode (using the production certificate and removing sandbox flag) try to send push notification message through control panel test panel I get the following error:

The Destination APNS server is not stated 
Use .withDestination(), withSandboxDestination(), or withProductionDestination().",
"token":null,
"javaClass":"com.liferay.pushnotifications.sender.BaseResponse",
"payload":null}


I've investigated a while looking at source code of Liferay Push Portlet (branch 6.2.x). I've seen that sandbox destination mode is set explitictly when sandbox is flagged in but it seems it doesn't set production Destination mode when sandbox is not flagged in.

https://github.com/liferay/liferay-plugins/blob/6.2.x/portlets/push-notifications-portlet/docroot/WEB-INF/src/com/liferay/pushnotifications/sender/apple/ApplePushNotificationsSender.java

but I'm not sure this is the cause of the problem.


Can you tell me if you have ever had similar problem or was able to setup iOS/Apple Push Notification portlet successfully in production mode?

Thanks,
Denis.
thumbnail
Bruno Farache, modified 8 Years ago. Liferay Master Posts: 603 Join Date: 5/14/07 Recent Posts
You're right, Denis.

For some reason this was fixed on EE 6.2 but didn't get backported to 6.2.x, which is weird.

The code should look like this:

if (isSandbox()) {
appleServiceBuilder.withSandboxDestination();
}
else {
appleServiceBuilder.withProductionDestination();
}

I will send a fix to the 6.2.x branch and release a new version of the portlet.

Thanks for reporting this.
thumbnail
Denis Signoretto, modified 8 Years ago. Expert Posts: 375 Join Date: 4/21/09 Recent Posts
Hi Bruno,

thanks for your feedback.

Just a question, I've seen that current version of Liferay Push CE on marketplace is 1.3.0.
What's the best way to checkout this version from liferay-plugins repository?

Thanks,
Denis.
thumbnail
Bruno Farache, modified 8 Years ago. Liferay Master Posts: 603 Join Date: 5/14/07 Recent Posts
I'm not sure, Denis, I will ask the release team how it works.

Every time they release they make commits like this one:

https://github.com/liferay/liferay-plugins/commit/f068ba2a9e6235b5b7c585f5909d62e4a8306ca3

As you can see, they increment the version number in liferay-plugin-package.properties. But I'm not sure how this "module-incremental-version" relates to the dot notation version they use for the plugin. I will ask the team to answer us.
thumbnail
Jeffrey Yang, modified 8 Years ago. New Member Posts: 4 Join Date: 2/24/12 Recent Posts
Hello Denis,

You can checkout Liferay Push CE 1.3.0 at the following:

Repository: https://github.com/liferay/liferay-plugins
Branch: 6.2.x
Commit: f068ba2a9e6235b5b7c585f5909d62e4a8306ca3
thumbnail
Bruno Farache, modified 8 Years ago. Liferay Master Posts: 603 Join Date: 5/14/07 Recent Posts
thumbnail
Denis Signoretto, modified 8 Years ago. Expert Posts: 375 Join Date: 4/21/09 Recent Posts
Hey Bruno,

I've just updated to 1.4.0 version and now and I can confirm that ios push notifications with production certificate are successfully delivered !

Thansk for your support!
Denis.
thumbnail
Sushil Patidar, modified 7 Years ago. Expert Posts: 467 Join Date: 10/31/11 Recent Posts
Hi Bruno,

Can i get help on thread

Regards
thumbnail
Mahmoud Elsonbati, modified 6 Years ago. New Member Posts: 22 Join Date: 12/10/14 Recent Posts
I have installed liferay CE push and configured it to use firebase push notification to work with android test app ..in the beginning it was working perfectly but when i changed the account of the  firebase project and used  the new Legacy server key it didn't work ..registering devices is working fine  but when sending push notifications to the device  nothing is sent andi get an error in the server log   ERROR [liferay/push_notification_response-1][PushNotificationsResponseMessageListener:41] {"payload":null,"javaClass":"com.liferay.push.notifications.sender.BaseResponse","id":null,"platform":"android","status":"HTTP Status Code: 400(Error=DeprecatedEndpoint)","succeeded":false,"token":null}

iam using  Liferay Community Edition Portal 7.1.2 CE GA3 and the Liferay CE Push i downloaded from marketplace and it supports  Liferay CE Portal 7.1 GA1+please advise
thumbnail
Javier Gamarra, modified 6 Years ago. Expert Posts: 348 Join Date: 2/12/15 Recent Posts
The legacy server way was shut down by Google a couple of months ago, you have to use firebase now.
thumbnail
Mahmoud Elsonbati, modified 5 Years ago. New Member Posts: 22 Join Date: 12/10/14 Recent Posts
It is firebase  what iam using actually ..i have tested changing the legacy key with the server key but in vain..i started to develop a custom notification portlet manually
thumbnail
Javier Gamarra, modified 5 Years ago. Expert Posts: 348 Join Date: 2/12/15 Recent Posts
I meant not using the legacy key and the firebase key instead. Legacy key can't work right now.
Leonard Duncan, modified 5 Years ago. New Member Post: 1 Join Date: 3/12/20 Recent Posts
Yup i had same problem like you mentioned erlier but after updating the version the problem is no more.
Leonard Duncan
Thank you
McDVOICE