We are planning on migrating to using topics through FCM for our application.
I have done some tests and have noticed a weird behaviour (looks very much like a bug).
When receiving a new token for the same InstanceID the https://iid.googleapis.com/iid/info/ endpoint still shows previously active topic subscriptions for this instance id.
But notifications sent to this topic do not arrive on the device.
These are the steps I took:
Get a token in the Android SDK
FirebaseInstanceId.getInstance().getToken(projectId, scope) => ABC:123
Subscribe to a topic in the Android SDK
FirebaseMessaging.getInstance().subscribeToTopic(topicName)
Verify the topic was subscribed to using the API call: https://iid.googleapis.com/iid/info/ABC:123?details=true
{
"applicationVersion": "1",
"connectDate": "2019-02-18",
"attestStatus": "UNKNOWN",
"application": "com.foo.bar",
"scope": "*",
"authorizedEntity": "12345",
"rel": {
"topics": {
"topicName": {
"addDate": "2019-02-18"
}
}
},
"connectionType": "WIFI",
"appSigner": "XXXXXXX",
"platform": "ANDROID"
}
Send a notification to the topic => notification arrives
Delete the token in the Android SDK
FirebaseInstanceId.getInstance().deleteToken(projectId, scope)
Get a new token in the Android SDK
FirebaseInstanceId.getInstance().getToken(projectId, scope) => ABC:456
Verify the topic was subscribed to using the API call: https://iid.googleapis.com/iid/info/ABC:456?details=true
{
"applicationVersion": "1",
"connectDate": "2019-02-18",
"attestStatus": "UNKNOWN",
"application": "com.foo.bar",
"scope": "*",
"authorizedEntity": "12345",
"rel": {
"topics": {
"topicName": {
"addDate": "2019-02-18"
}
}
},
"connectionType": "WIFI",
"appSigner": "XXXXXXX",
"platform": "ANDROID"
}
Just to verify this is the new response for the deleted token.
https://iid.googleapis.com/iid/info/ABC:123?details=true
{ "error": "No information found about this instance id." }
Send a notification to the topic => notification does not arrive!
This behavior does not restore. (We waited a full day).
Why does the info endpoint show that the new token was subscribed to the topic, but in reality is not registered at all?
The only fix seems to be re-subscribing the new token on the topic.
Thanks in advance.
Related
I use Firebase for notification in my Android application and try create custom sound for notification in background. Client app doesn't handle notifications, only android system. Notifications are sent from backend. Json structure:
{
"message": {
"token": "e1IMKJe...",
"notification": {
"title": "Test",
"body": "Test message from server"
},
"android": {
"notification": {
"sound": "sound_base_notification",
"channel_id":"test_chanel_id"
}
}
}
}
In method onMessageReceived, I obtained response like this:
Bundle[{google.delivered_priority=normal, google.sent_time=1596444752253, gcm.notification.android_channel_id=chanel_id_test,
google.ttl=23746652,
google.original_priority=normal,
gcm.notification.e=1,
gcm.notification.sound=default,
gcm.notification.title=Test,
from=763552563,
gcm.notification.sound2=sound_base_notification,
google.message_id=0:1596...,
gcm.notification.body=Test message from server,
google.c.a.e=1,
google.c.sender.id=29852264618,
collapse_key=com.test}]
Could you help me understand where does the gcm.notification.sound2 come from although in json push exsist onle single key sound?
Note: Was testing on Android 10
Is it possible that push notification on Android of google drive works
If I make AppEngine project which i registered as domain.
code not working
Drive.Changes.List request1 = mService.changes().list(startpageToken);
ChangeList changes1 = request1.execute();
Channel channel = new Channel();
channel.setId(UUID.randomUUID().toString());
channel.setType("web_hook");
channel.setAddress("https://ggledrvsrvcaccnt.appspot.com/hello");
System.out.println(" **channel
Id"+channel.getId()+"paggtoken"+startpageToken);
Channel c = mService.changes().watch(startpageToken,
channel).execute();
System.out.println("ResourceId"+c.getResourceId());
System.out.println("Kind"+c.getKind());
System.out.println("resuri"+c.getResourceUri());
System.out.println("token"+c.getToken());
System.out.println("expi"+c.getExpiration());
output is
**channel Iddce0eb26-e23d-43f8-a50b-a68aee2aa286paggtoken508
ResourceId nT5QxvC2hKhVrDdPn61i5H6Jr10
Kind api#channel
resuri https://www.googleapis.com/drive/v3/changes?includeCorpusRemovals=false&includeRemoved=true&includeTeamDriveItems=false&pageSize=100&pageToken=508&restrictToMyDrive=false&spaces=drive&supportsTeamDrives=false&alt=json
token null
expi 1493122880000
But still not able to get notification on status bar
If i check in api explorer
All Versions > Drive API v3 > drive.changes.watch
{
"error": {
"errors": [
{
"domain": "global",
"reason": "push.webhookUrlUnauthorized",
"message": "Unauthorized WebHook callback channel:
https://ggledrvsrvcaccnt.appspot.com/hello"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel:
https://ggledrvsrvcaccnt.appspot.com/hello"
}
}
Please Let me know Am I on wrong track
For checking Notification that is information in notification
which event or service to invoke in android code..
We are running MobileFirst Consumer Edition 7.0 We have a Liberty Server.
A majority of our users are able to successfully authenticate using our Mobile App with a AD Login.
A few users have reported that the log in hangs. Some other relevant information: the users who have experienced this issue are using Android 5.0.2. I can log in as them on other versions of Android without any problem. (I personally haven't been able to duplicate this). When they log in, I am seeing this error in the logs when the login hangs. What could be the issue? If you need additional logs or a copy of the code, I can supply that via email. I just do not wish to disclose full logs here.
{
"message": "Session ended for user \u0027REMOVED\u0027",
"level": "INFO",
"source": "server",
"threadId": 52,
"loggerName": "com.worklight.core.util.AuditBean",
"timestamp": "25-08-15 10:50:45:320"
},
{
"message": "Session ended for user \u0027REMOVED\u0027",
"level": "INFO",
"source": "server",
"threadId": 52,
"loggerName": "com.worklight.core.util.AuditBean",
"timestamp": "25-08-15 10:42:27:321"
},
{
"message": "FWLSE0048E: Unhandled exception caught: java.util.NoSuchElementException\ncom.worklight.gadgets.GadgetRuntimeException: java.util.NoSuchElementException\n\tat com.worklight.gadgets.api.GadgetAPIRequestCoder.decodeGadgetRequestInfoStandard(GadgetAPIRequestCoder.java:408)\n\tat com.worklight.gadgets.api.GadgetAPIRequestCoder.decodeGadgetRequestInfo(GadgetAPIRequestCoder.java:236)\n\tat com.worklight.gadgets.utils.GadgetUtils.getApplicationEnvironmentFrom(GadgetUtils.java:225)\n\tat com.worklight.core.auth.impl.AuthenticationFilter.isDeviceDisabled(AuthenticationFilter.java:535)\n\tat com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:186)\n\tat com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)\n\tat com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)\n\tat com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:975)\n\tat com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1097)\n\tat com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:81)\n\tat com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:912)\n\tat com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262)\n\tat com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:938)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n\tat java.lang.Thread.run(Thread.java:722)\nCaused by: java.util.NoSuchElementException\n\tat java.util.StringTokenizer.nextToken(StringTokenizer.java:349)\n\tat com.worklight.gadgets.api.GadgetAPIRequestCoder.decodeGadgetRequestInfoStandard(GadgetAPIRequestCoder.java:367)\n\t... 15 more\n [project MyGPCMobile]",
"sourceClass": "com.worklight.core.auth.impl.AuthenticationFilter",
"sourceMethodName": "doFilter",
"throwable": {
"message": "java.util.NoSuchElementException",
"stacktrace": [
"com.worklight.gadgets.api.GadgetAPIRequestCoder.decodeGadgetRequestInfoStandard(GadgetAPIRequestCoder.java:408)",
"com.worklight.gadgets.api.GadgetAPIRequestCoder.decodeGadgetRequestInfo(GadgetAPIRequestCoder.java:236)",
"com.worklight.gadgets.utils.GadgetUtils.getApplicationEnvironmentFrom(GadgetUtils.java:225)",
"com.worklight.core.auth.impl.AuthenticationFilter.isDeviceDisabled(AuthenticationFilter.java:535)",
"com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:186)",
"com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)",
"com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)",
"com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:975)",
"com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1097)",
"com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:81)",
"com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:912)",
"com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262)",
"com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:938)",
"java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)",
"java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)",
"java.lang.Thread.run(Thread.java:722)"
]
},
"level": "SEVERE",
"source": "server",
"threadId": 196547,
"loggerName": "com.worklight.core.auth.impl.AuthenticationFilter",
"timestamp": "25-08-15 10:40:07:590"
},
{
"message": "Session started for user \u0027REMOVED\u0027",
"level": "INFO",
"source": "server",
"threadId": 191685,
"loggerName": "com.worklight.core.util.AuditBean",
"timestamp": "25-08-15 10:39:43:905"
},
{
I want to use paypal express checkout in paypal to get the token ID to send the ID to the server. At the moment I am using the general paypal and I get a response like this:
{
"payment": {
"short_description": "Coffee Payment",
"amount": "24",
"currency_code": "AUD"
},
"client": {
"platform": "Android",
"paypal_sdk_version": "1.2.3",
"product_name": "PayPal Android SDK; ",
"environment": "sandbox"
},
"proof_of_payment": {
"adaptive_payment": {
"timestamp": "2014-03-26T03:22:09+0000",
"payment_exec_status": "COMPLETED",
"app_id": "APP-80W284485P519543T",
"pay_key": "AP-6N7046464K788532B"
}
}
}
But I need to get the token using paypal express. I would greatly appreciate if the way to do this can be shown.
That sample is using Adaptive Payments. The Express Checkout portion of the REST CreatePayment API is what you're after.
i have done implementation. If you have read the docs in the paypal developer page, the only problem you should be having is generating the access token. The access token is generated as follows:
<?php
require_once ("include/braintree_init.php");
require_once 'vendor/braintree/braintree_php/lib/Braintree.php';
/*if(file_exists(__DIR__ . "/../.env")) {
$dotenv = new Dotenv\Dotenv(__DIR__ . "/../");
$dotenv->load();
}*/
$clientToken = $gateway->clientToken()->generate();
$output = json_encode(array("response" =>$clientToken)) ;
echo $output;
After send the output to your android. And that's it. But you will have to have the include files that i have included.
I am doing sample PoC using GCM. I send the registration request to gcm server from my device and got the registration id for successful registration. I stored all the registration id in my app server database. I sent the data only one time to GCM from my app server to all my registration id. But, the OnMessage() method of GcmBaseIntentService called multiple time.
here is GCM response to my appserver when i am sending data
{
"multicast_id": 5986417894970376000,
"success": 7,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:1355230384617663%9fa953f8f9fd7ecd"
},
{
"message_id": "0:1355230384617914%9fa953f8f9fd7ecd"
},
{
"message_id": "0:1355230384617911%9fa953f8f9fd7ecd"
},
{
"message_id": "0:1355230384617987%9fa953f8f9fd7ecd"
},
{
"message_id": "0:1355230384617909%9fa953f8f9fd7ecd"
},
{
"message_id": "0:1355230384617985%9fa953f8f9fd7ecd"
},
{
"message_id": "0:1355230384618032%9fa953f8f9fd7ecd"
}
]
}
I am doing some time taking task in my onMessage() method using AsynTask, Due to this multiple calls multiple thread getting created.
Please advice me on this issue.
The problem with my server side code. Single registration id added multiple times in devices list of my payload data.