Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Unable to register android device using Liferay Push
Hi
I am using Liferay DXP 7.1
installed liferayPush.lpkg
followed the portal document for push notification in android. generated fcm key and added into portal
But unable to register device.Getting this exception :
but in portal/api/jsonws its displaying the service
code for registering device i am using :
I am using Liferay DXP 7.1
installed liferayPush.lpkg
followed the portal document for push notification in android. generated fcm key and added into portal
But unable to register device.Getting this exception :
No JSON web service action with path /push-notifications-portlet.pushnotificationsdevice/add-push-notifications-device and method null for push-notifications-portlet
but in portal/api/jsonws its displaying the service
/pushnotifications.pushnotificationsdevice/add-push-notifications-device
code for registering device i am using :
Session session2 = SessionContext.createBasicSession("test@test.com", "test");
UserService userService=new UserService(session2);
JSONObject user= userService.getUserByEmailAddress(20100,"test@test.com");
User userObject=new User(user);
SessionContext.setCurrentUser(userObject);
Push.with(SessionContext.createSessionFromCurrentSession()).register("xxxxxxxxxx");
also tried with this Push.with(session2 ).register("xxxxxxxxxx");
Declared PushService and PushReciever as well.Still i cant see any register device in portal.Any Help would be appreciatedThanks
Hey,
you have to indicate the 70 version like: Push.with(session2 ).withPortalVersion(70).register("xxxxxxxxxx");
you have to indicate the 70 version like: Push.with(session2 ).withPortalVersion(70).register("xxxxxxxxxx");
Hi Victor,Thanks for your quick reply. it worked and device is registered.Now i am facing issue in recieving notification.i added the files for PushReceiver and PushService also declared them in manifest.xml
{ "message": "Hello You have one new alert" }
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
<receiver android:name=".PushReceiver" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.liferay.mobile.push" /> </intent-filter> </receiver> <service android:name=".PushService" android:permission="android.permission.BIND_JOB_SERVICE" />
There might be the issue with sending notification from portal.Facing this error by sending below message{ "message": "Hello You have one new alert" }
[liferay/push_notification_response-1][PushNotificationsResponseMessageListener:41] {"payload":"{\"message\":\"Hello You have one new alert\"}","javaClass":"com.liferay.push.notifications.sender.android.internal.AndroidResponse","id":null,"canonicalRegistrationId":null,"platform":"android","status":"InvalidRegistration","succeeded":false,"token":"XXXXXXX"}
Can you please help me in this. Thank you
Hi.
Its solved. I just maitained the PushService and now its displaying notifications
Thanks for your help
Its solved. I just maitained the PushService and now its displaying notifications
Thanks for your help
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™