Fiksu SDK Integration - android

I am trying to implement Fiksu SDK for Android and iOS.
I am able to add code to track registration and purchase :
FiksuTrackingManager.uploadRegistration(Context, FiksuTrackingManager.RegistrationEvent.EVENT1);
FiksuTrackingManager.uploadPurchase(Context, FiksuTrackingManager.PurchaseEvent.EVENT1, 0, "USD");
In iOS i am able to get the logs in the console, but in android i am only getting logs which event is called.How can i check the logs in Android ?
Also how to track the app events in Fiksu dashboard ?
They have also mentioned to add client id , from where will i get the client id ?
if any one has implemented it please guide me how to proceed ?

this might be too late but it may help someone that comes across this post.
I just had to integrate the Fiksu SDK for android for a client and face similar issues when testing.
How can i check the logs in Android ?
If the SDK has been properly installed you should be able to see some logs like below which means the events have been succesfully sent to their server.
11-25 10:04:31.010 21588-23132/ D/FiksuTracking? Event: Resume
11-25 10:04:32.320 21588-23132/ D/FiksuTracking? Successfully uploaded tracking information.
11-25 10:05:40.500 21588-23383/ D/FiksuTracking? Event: Purchase
11-25 10:05:42.180 21588-23383/ D/FiksuTracking? Successfully uploaded tracking information.
how to track the app events in Fiksu dashboard ?
This part is quite annoying as they don't have a way to create Apps in the dashboard and link them to your android app so you can see your events coming through. Instead you have to actually perform the test and send them an email for someone from Fiksu to check their servers and track your events.
These are the test steps as per their documentation:
Download and install your application on an Android device and perform your tests.
Fill a form they have and send it via email to their support team.
Someone will get back to you confirming if they have received your events.
They have also mentioned to add client id , from where will i get the client id ?
The clientId is just an identifier for your users within your app. In other words you can set that to whatever you want (e.i. email address). The suggestion is to set this after a user has registered or logged in in your app.
FiksuTrackingManager.setClientId(Context, "XXX");
Based on their documentation: "Where XXX would be the ID you want to send and can be any alphanumeric string up to 64 characters long. All events sent after this call is made would send the Client ID that has been set. If you call setClientID again it will overwrite whatever was there before. However the first Client ID sent with an event will be the Client ID that is in the export on the Fiksu Client Dashboard and it will not get updated."
if any one has implemented it please guide me how to proceed ?
So to sum up below are the steps to integrate the Fiksu SDK for android.
Downlaod the SDK.
Add the SDK jar to your project.
Set the isntall receiver (Only if you want to track app installs). NOTE that they expect to be the only receiver in the AndroidManifest.xml file. If you are using other third party SDKs to track the same you either:
Use fiksu to forward the intent:
<receiver android:name="com.fiksu.asotracking.InstallTracking"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
<!-- Forward to other receivers -->
<meta-data android:name="forward.1"
android:value="com.google.android.apps.analytics.AnalyticsReceiver" />
<meta-data android:name="forward.2" android:value="com.mypackage.thirdparty.MdotmReceiver" />
</receiver>
Or set the below flag in your AndroidManifest and have another install receiver forward it to the fiksu SDK.
<meta-data android:name="FiksuDisableReceiverCheck" android:value="true" />
Set the permissions in your AndroidManifest.
android.permission.INTERNET
android.permission.READ_PHONE_STATE
Initialize the SDK. Normally on your Application onCreate() method.
FiksuTrackingManager.initialize(this);
Setting up Google Play Services on your project.

Related

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.

How to implement AndroidPay auto OTP filling?

So I have a verification code that comes through from sms and user has exit app to go copy it into an EditText.
I found out the Android Pay has a method to scan the incoming verification text from your bank and autofill the text with a verification code.
I'd like to replicate this for my own app but I'm not 100% sure how I do this as I'm struggling to search for what I need. What I've found so far is it could be done via a ContentResolver but that might not be the best solution as it could be different on different Android flavours.
You want a broadcast receiver for SMS, which reads an incoming SMS, checks if the number is right and if the format of the SMS is right, and parses the number from it.
Actually if you can do that there's no need to autofill- just send the request to the correct API for verification directly, so they don't even have to press send.
Android has this built in since play services 10.2.x.
It works only if you include an app specific hash in the SMS message body, which android uses to determine which app to alert that a new message just came in.
When an SMS message with that exact hash is received, android will fire up a broadcastreceiver that youregister in the manifest with a special intent filter:
<receiver android:name=".MySMSBroadcastReceiver" android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.auth.api.phone.SMS_RETRIEVED"/>
</intent-filter>
</receiver>
How it works in more detail and what code is required etc, you can check here on the developer's blog or here in the official guides.
Note that this won't work if you don't have access to the system that sends out the SMS, meaning you can't add the hash to the message.

Android wear not uploading data to Firebase

Instead of using the Data Layer and sending the data to phone, and uploading it from there, I simply wrote this code under a button:
Firebase ref = new Firebase("https://poponfa-8a11a.firebaseio.com/");
ref.child("lol").setValue("lol");
But for some strange reason, it usually suddenly stops working, pressing the button uploads nothing to firebase even though the phone is connected to the watch and internet. My question is, why is this behaviour occurring and how do I go about uploading directly from Wear, as I don't want to keep services running in the mobile App.
Haven't tried this personally, but you may want to try Identifying your Wear app as standalone.
Add the following in your Android Manifest file:
<application>
...
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
...
</application>
With this, a watch app can be considered as one of the following:
Completely independent of a phone app
Semi-independent (a phone app is not required and would provide only
optional features)
Dependent on a phone app
Then, you can proceed with saving data directly from your Wear.
See Read and Write Data on Android for more information.

2 GCM registrationId for same android application

I have 2 GCM BroadcastReceivers in my application (One for an android library integrated in my application and one for my own application).
Both of them are registered in the manifest and have the same category (Which is my application package name).
Both have registration with register() function and both receives different valid registrationId's (because the senderId for both are different).
My problem is that I have everything work fine (Both Recievers get the push notification) but after a couple of hours when trying to send a push from Server I encounter "NotRegistered" issue in my server (android library regId) and registrationId seems invalid all of a sudden.
So my question is can I have 2 different GCM "Mechanism" in the same application with different senderId without a collision or some sort on GCM Servers ?
In that case, It will never create collision as both will work as different applications (Both is having different SENDER_ID).
Check the following notes :
1) Make sure that you have added different category name (With INTENT-FILTER) for both library and application :
<receiver
android:name=".xxxxx"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.xxxx" />
</intent-filter>
</receiver>
2) Sometimes the Reg Id is getting changed automatically so try to save the previous one and check each time if it is same, if not then you have to update new one with your server.
UPDATE :
When you send a message, you specify a registration ID, which is implicitly linked to the package name of the app and device where it was generated. Only the app which requested the registration ID will receive your message. So it will conflict because you are using the same library (Same Package name) with different applications.
So your solution might be to do all stuff related to GCM in SingleToneClass with library. In which you will pass your application package name to register with GCM. So whenever you will use your library with different applications, It will refer different package name and SENDER_ID will be the same but it will not cause problem as package name will be changed.

GoogleCloudMessaging.register(SENDER_ID ) returns null

i am facing issue with registering device with GoogleCloudMessaging for push notifications
the source code can be found here:
https://github.com/ronenhamias/ezPushSDK-Android
the problem i am facing it that calling register to device returns null 70% of the times some time the registration succeed mainly when i am using the android studio emulator but when another developer runs the app or debugging it on a real device it returns null
please note that i created the project and got sender id and api key and was able to push with this keys several times.
for some reason the integration with the cloud returns null.no error is thrown, and no further information is provided
what can be the reasons for that?
Hope It work for You..
Please change
<receiver android:name=".gcm.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
TO
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
And If It not Then Use GCM.jar file and change IntentService to extends GCMBaseIntentService and use its default methods..
Its easy and simple to use..
and refer this link so You can easy to understand

Categories

Resources