留言板

Error sending Apple iOS Push Notifications

thumbnail
Denis Signoretto,修改在7 年前。

Error sending Apple iOS Push Notifications

Expert 帖子: 375 加入日期: 09-4-21 最近的帖子
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,修改在7 年前。

RE: Error sending Apple iOS Push Notifications

Liferay Master 帖子: 603 加入日期: 07-5-14 最近的帖子
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,修改在7 年前。

RE: Error sending Apple iOS Push Notifications

Expert 帖子: 375 加入日期: 09-4-21 最近的帖子
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,修改在7 年前。

RE: Error sending Apple iOS Push Notifications

Liferay Master 帖子: 603 加入日期: 07-5-14 最近的帖子
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,修改在7 年前。

RE: Error sending Apple iOS Push Notifications

New Member 帖子: 4 加入日期: 12-2-24 最近的帖子
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,修改在7 年前。

RE: Error sending Apple iOS Push Notifications

Liferay Master 帖子: 603 加入日期: 07-5-14 最近的帖子
thumbnail
Denis Signoretto,修改在7 年前。

RE: Error sending Apple iOS Push Notifications

Expert 帖子: 375 加入日期: 09-4-21 最近的帖子
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,修改在6 年前。

RE: Error sending Apple iOS Push Notifications

Expert 帖子: 467 加入日期: 11-10-31 最近的帖子
Hi Bruno,

Can i get help on thread

Regards
thumbnail
Mahmoud Elsonbati,修改在4 年前。

RE: Error sending Apple iOS Push Notifications

New Member 帖子: 22 加入日期: 14-12-10 最近的帖子
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,修改在4 年前。

RE: Error sending Apple iOS Push Notifications

Expert 帖子: 348 加入日期: 15-2-12 最近的帖子
The legacy server way was shut down by Google a couple of months ago, you have to use firebase now.
thumbnail
Mahmoud Elsonbati,修改在4 年前。

RE: Error sending Apple iOS Push Notifications

New Member 帖子: 22 加入日期: 14-12-10 最近的帖子
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,修改在4 年前。

RE: Error sending Apple iOS Push Notifications

Expert 帖子: 348 加入日期: 15-2-12 最近的帖子
I meant not using the legacy key and the firebase key instead. Legacy key can't work right now.
Leonard Duncan,修改在4 年前。

RE: Error sending Apple iOS Push Notifications

New Member 发布: 1 加入日期: 20-3-12 最近的帖子
Yup i had same problem like you mentioned erlier but after updating the version the problem is no more.
Leonard Duncan
Thank you
McDVOICE