Google Nearby messages API not working - android

I have registered a beacon and attached data using Google Proximity API. Next, I have written a test Android app to listen for beacons and subscribe messages created in my dev console. I have followed all steps documented here and here. The issue is that the onFound callback is never called.
#Override
public void onFound(Message message) {
Log.i(TAG, "Found message: " + message);
}
API info here
Do I need any specific permissions within my AndroidMannifest.xml?
I have only added a com.google.android.nearby.messages.API_KEY meta-data attribute in my manifest.

I faced the same problem while I used Estimote Beacon. It appears by default it comes up with 'iBeacon' profile.
Based on my personal experience, iBeacon is not detected by NearBy API. I tried changing the beacon profile to 'EddyStone-beacon' and it started detecting.
Can you try changing the beacon profile to EddyStone and try?

You'll need to subscribe to the messages for the beacons via attached data namespaces and types — all done via filters. This is documented here at Google developers
One other key to not miss is that you must set the result callback with setResultCallback. Not setting seems to mean that your callbacks won't get called all the time.

I'm using the nearby messages API without problems. I find this google example very interesting: https://github.com/googlesamples/android-nearby/blob/master/messages/NearbyDevices/app/src/main/java/com/google/android/gms/nearby/messages/samples/nearbydevices/MainFragment.java
Remember to change your subscribe options and set the strategy in this way: Strategy.BLE_ONLY
In your manifest you have to add only the Key, but rememeber to enable NearbyMessages API in your developer console.

Related

Why does the API that obtains the archive image size for the saved game function report an error?

I developed a game app and integrated HUAWEI Game Service. However, when I called the API for obtaining the archive image size following instructions in the documentation, the result code 7002 was returned. I cannot locate the fault. What can I do?
The relevant log information is as follows:
Line 560: 2020-03-17 21:12:48.436 7644-17452/? I/ServerConstant: [I/HwJOS/ServerConstant 7644:25555 :108] get DRIVE serverUrl cost:4,isEmpty:false,isChina:false, Url:https://drive-drru.cloud.hicloud.com
Line 3567: 2020-03-17 21:12:48.600 7644-17452/? I/HMSGameArchiveRequest: [W/HwJOS/HMSGameArchiveRequest 7644:25558 :172] response not GetArchiveMetadataResponse.code: 7002
Line 3568: 2020-03-17 21:12:48.601 7644-17452/? I/HMSGameHelper: [I/HwJOS/HMSGameHelper 7644:25558 :92] reportInterfaceAccessStartBIEvent interfaceName: HMSGetArchiveMaxSizeRequest.getArchiveMaxSize duration: 0 result: 7002
Further question: Are there any precautions for calling other APIs of HUAWEI Game Service? I also plan to use the events and achievements features of HUAWEI Game Service.
Error code 7002 indicates that the server is abnormal. You need to ensure that your service location is the same as the location where your HUAWEI ID was registered.
Only devices whose service location is the same as the location where the currently signed-in HUAWEI ID was registered can call this API. To check the registration location, go to Account center > Settings > About. To check your service location, go to AppGallery > Me > Settings > Country/Region.
Huawei provides a full set of APIs for you to quickly implement multiple game functions. For details, please refer to the following documents:
Events, Achievements, Leaderboards, Saved games, Player status.
Here you can find the list of error codes for Game service. 7002 is network error, meaning there was a problem communicating with Huawei server. Check your network and proxy settings.

Firebase Dynamic Links - Can't get Url in android after install app from play store

If I install the app when clicking the dynamic link. All of that information from dynamic should be still available when I open the app for the first time.How can I get that information? It is not working when I use this: getInitialLink() returns Promise<string|null>;
Since, you haven't mentioned - I'm assuming you are having problems with shorter urls, if that's the case try putting the longer url.
Or refer here on Simon's answer: When I use the long instead of short links, everything works perfectly fine.
On Android, you use the getInvitation() method to get data from the Dynamic Link:
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false).setResultCallback
(/* ... */);
Then, in the callback, you can get the data passed in the Dynamic Links link parameter by calling the getDeepLink() method:
Firebase Documentation - Use Case
For future reference or detailed answer on Firebase Dynamic Links
Behave just like normal Links
In cases where the application doesn’t require installation (say, if it’s already installed) then clicking the Dynamic Link will automatically open the link to the desired screen.
Dynamic Links have a very simple process flow:
The user begins by clicking the Dynamic Link
If the the needs of the Dynamic Link target are satisfied (this is, the application being installed) then the user is navigated to the target location
Otherwise, if the application requires install in order to navigate
to the Dynamic Link target, the the user is taken to the point of
install for the application. Once the application has been installed,
the user is navigated to the target location of the Dynamic Link
And if that wasn’t all, we can integrate Dynamic Links with Firebase Analytics to track the interaction with any links that we generate for our applications. But if we only require simple tracking, then we can use the automatic built-in analytics from the Dynamic Links panel within the Firebase Console where we can also obtain attribution and referrer information for interacted links with no extra effort required from our side.
What makes it different from Google Analytics?
One of the first things that came to my mind when I read about Firebase Analytics was, “What about my Google Analytics setup?”. So if you already have Google Analytics in place, then why would you make the switch to Firebase Analytics? Well, here’s a couple of differences between the two:
Audiences
We can use Firebase Analytics to create Audiences — these are groups of users that we can then interact with using other Firebase service such as Firebase Notifications and / or Firebase Remote Config.
Integration with other Firebase Services
An awesome thing with Firebase Analytics is that we can integrate other Firebase services with analytics. For example, creating an Audience of users who have experienced a crash reported through Firebase Crash Reporting.
Lower Method Count
The Google Analytics dependency on Android has a total count of 18,607 methods and has a total of 4kb used for dependancies. On the other hand, Firebase Core (for Analytics) has a method count of 15,130 and only 1kb used for dependancies.
Automatic Tracking
When we add the firebase core dependency, it will automatically begin tracking a collection of user engagement events and device information for us — this is useful if you’re looking to only collect the minimal data for your app.
Unlimited Reporting
For up to 500 events, Firebase Analytics provides us with unlimited reporting straight out of the box for free!
No Singleton Initialisation
When setting up Google Analytics on Android we are required to initialize a Singleton instance. Firebase Analytics are simply available by fetching the instance directly from where we wish to track data. This isn’t much effort obviously but just makes the setup flow slightly easier.
Single Console
All of the data for every Firebase service is available for a single console. That makes it both easier and quicker for us to navigate from checking the analytic stats for our app to viewing the latest crash reports.
It looks like this is a react-native-firebase open bug for android
For fix the only thing that is required to be changed in module code:
private boolean isInvitation(PendingDynamicLinkData pendingDynamicLinkData) {
return FirebaseAppInvite.getInvitation(pendingDynamicLinkData) != null;
}
to
private boolean isInvitation(PendingDynamicLinkData pendingDynamicLinkData) {
FirebaseAppInvite invite = FirebaseAppInvite.getInvitation(pendingDynamicLinkData);
if (invite != null && invite.getInvitationId() != null && !invite.getInvitationId().isEmpty()) {
return true;
}
return false;
}
Bug reference : https://github.com/invertase/react-native-firebase/issues/1273
Please Check Your Manifest file
open AndroidManifest.file => In your activity tag there is intent-filter tag put below line in that tag.
<data android:scheme="https" android:host="your.dynamic.link" />
<data android:scheme="http" android:host="your.dynamic.link" />
If already done then check this link for the full blog on the dynamic link with react native.
Link: http://blog.logicwind.com/react-native-dynamic-links-using-firebase/
I hope this will help. sorry for the typos.

Does Facebook Messenger Bot provide information about the channel where the message was originated?

I'm having a problem with the lite version of messenger (android only)
This version of the application does not support bot messages with templates or buttons (including the get_started button)
In my case this is an example:
I could not find a parameter in the webhooks to provide the user's platform.
So I have to ask the user: do you use the lite version?
And then set a different flow.
But this means that I must also give the possibility to disable the lite mode when browsing from the web or from the non-lite application (to guarantee a better user experience)
Does Facebook Messenger Bot provide information about the channel where the message was originated ?
This information is not provided via webhook, currently. The closest you can get is detecting user agent in the webview.
A not ideal but doable option would be to have something like a 'Switch to Lite' button in the persistent menu
One way to identify where message event originates from is to use the payloads. You can specify a unique payload when setting up your bot and check what you receive to react on. get_started, persistent_menu, quick_replies have a payload field that you can set.
{
"get_started":{
"payload":"<GET_STARTED_PAYLOAD>"
}
}

Google Nearby notification API not showing new notifications

This is my first post here so please excuse my mistakes.
I am trying to work with Nearby notification. I have added the beacon via "beacon tools" and from my dashboard have added nearby notification. As you can see in the picture, the new notifications are appended at the bottom.
Nearby notification dashboard_img
So in this case, "Title #3" is the latest and that's the one I see in Nearby app when I am next to beacon.
Now, when I tried adding Nearby notifications to my beacons via Proximity API.
I have added the beacon to my project, and I am using
gapi.client.request
to add an attachment to my beacon, using the Proximity beacon API. The add attachment URI:
https://proximitybeacon.googleapis.com/v1beta1/beacons/(BeaconName)/attachments
I am formatting the attachment as such
{
"title": "Example",
"url": "https://www.example.com"
}
When I added 3 notifications via this (one at a time of course), they do show up in my google dashboard for that beacon. But the new ones are stacked on the top, instead of appending at bottom(as seen in the second pic)
Nearby notification dashboard_img
So as you could guess, only the first added notification is visible via Nearby, i.e "Title #1"
Am I missing something here? How do I make the new notifications appear using Proximity API?
PS: I am using Eddystone UID for this.
Update
It seems this was a bug and I had been trying to contact Google in several ways. Finally it reached them and they fixed it today :)
So latest notifications are now automatically displayed & targeting works well.
Kudos to Google engineers working on Nearby!

PlayBasis not registering users, getting message='User doesn't exist'

I'm trying to register users on my PlayBasis App using the Android SDK. However, it's not registering them.
The method
PlayerApi.register onSuccess()
is being called but the users never get registered. They don't show on the dashboard and when I try to get them I receive
RequestError{message='User doesn't exist', errorCode=200}
Can you recommend any other gamification platform that offer low price for small/indie apps?
I have investigated the case and found that
you actually can registered 7 players into our system on 24 September.
And this would also explain why Android SDK fires onSuccess().
However, it is like the problem is that you cannot find those players.
Just want to verify with you first that for getting detail of player,
you should supply "player_id", NOT "username".
Lastly, on "User" menu on the dashboard, you are going to find
only the list of dashboard users, NOT the list of players.
Best Regards,
Thanakij

Categories

Resources