Firebase Analytics preventing proper use of dynamic link - firebase

I'm running in trouble here with Firebase.
The code is in flutter, I am testing in iOS
It's all going well, but when I try to get the dynamic link sent from:
auth.sendSignInWithEmailLink(parameters);
I get a debug message:
[Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
amv = 16;
apn = "com.myproject.app";
ibi = "com.myproject.app";
ifl = "https://myproject-com.firebaseapp.com/__/auth/action?apiKey=XXXXXXXXXXX&mode=signIn&oobCode=XXXXXX&continueUrl=https://myproject-com.firebaseapp.com/email123&lang=en";
link = "https://myproject-com.firebaseapp.com/__/auth/action?apiKey=XXXXXXX&mode=signIn&oobCode=XXXXXX&continueUrl=https://myproject-com.firebaseapp.com/email123&lang=en";
}
where I changed my project name to "myproject" and put XXX inplace of apiKey/oobcode
and then, when I try to get the dynamic link with my app
final PendingDynamicLinkData data = await FirebaseDynamicLinks.instance.getInitialLink();
data is null.
So I am guessing Firebase Analytics is processing it and "killing" the dynamic link before my app can parse it.
Anyone managed to go through this?

I found the problem.
It is not that Firebase Analytics was "consuming" and killing the deep link.
The thing is that in iOS still today there is a delay the link and the state cycle...
https://medium.com/#diegoveloper/flutter-firebase-dynamic-link-6f1b79278ce0
This link explains it, problem 2 in the blog post.
Solved. I can still use analytics in Firebase.
It is impossible to remove analytics btw, you can only disable it.

Related

Firebase & Flutter (on Android) - MessagingToken is null

I'm running into trouble with some of my app's subscribers. We recently introduced the ability to send out notifications to our users using FirebaseMessaging. I should also mention that the app is on Android only.
Here is a brief section of code that we are running
updateUser(Userx user) async {
var messagingToken = await FirebaseMessaging.instance.getToken();
var packageInfo = await PackageInfo.fromPlatform();
user.messagingToken = messagingToken!;
user.appVersion = packageInfo.version;
await Users.updateUser(user);
}
It turns out that the FirebaseMessaging.instance.getToken() sometimes returns null and I can't figure out why that would be the case. The documentation also doesn't say much.
Could this be device specific? Maybe a user-setting to not allow any in-app messages?
A potential workaround is of course to null-check the token and simply accept it being null but I would like to understand the reasons behind that.
I found one more method that could be helpful, but I'm unsure about it.
Call FirebaseMessaging.instance.isSupported() first and act based on the result.

Firebase Analytics: How to get and integrate UA-type measurement ID instead of G-type measurement ID for Firebase Analytics?

I am running a React web app on Firebase. Firebase automatically generates G-type measurement ID (G-XXXX). I'd like to get a UA-type measurement ID (UA-XXXX) and somehow integrate it into Firebase project.
Reason: I want to use React-GA package (https://github.com/react-ga/react-ga) but the package apparently does not support G type measurement IDs.
Is there any way to create and integrate the UA-type measurement ID somehow to Firebase project configuration? I'd love to see the data reflected into the Firebase console dashboard, not having to leave the console to see the data.
Any idea on how to do this? Thanks!
I had done it before with the same package.
First; you need to add a "universal analytics property" manually on google analytics page. Because Firebase is only using latest version. Click admin icon at the bottom-left and then click + Create Property
You will see Show Advanced Options button. Enable this of an earlier version of Google Analytics. Once you finish you get your UA-xxxx code.
import ReactGA from 'react-ga';
class GAService {
init() {
ReactGA.initialize('UA-XXXXXXX-X');
//ReactGA.pageview(window.location.pathname + window.location.search);
}
}
const instance = new GAService();
export default instance;

Flutter Dynamic Links get added parameters

So, I am currently using Flutter to develop an IOS-App and added Firebase.
I am trying to use PayPal-Connect with the url_launcher package. As the PayPal-Connect link looks like this:
https://www.sandbox.paypal.com/connect?flowEntry=static&client_id=[<my_client_Id>]&scope=&redirect_uri=[<my_url>]
I am trying to use Firebase Dynamic Links for the redirect_uri to go back to the app and fetch the data I got from Pay-Pal as url parameters. The problem is that whenever I run this code:
Future<void> retrieveDynamicLink() async {
final PendingDynamicLinkData data = await FirebaseDynamicLinks.instance.getInitialLink();
final Uri deepLink = data?.link;
if (deepLink != null) {
print(deepLink);
print(deepLink.queryParameters['code']);
}
}
The logs say:
flutter: https://domain.page.link/ppc
flutter: null
But I know from the Paypal-Connect Docs that they add a code=[<some_code>] parameter.
But is the thing I plan to do even possible with Dynamic Links? Or Am I doing something completely wrong?
Checking the implementation, it looks like you're trying to implement something similar to a reward referral use case. The reason why deepLink.queryParameters['code'] returns null is because there's no code parameter configured on the deep link of the Firebase Dynamic Link that has been handled.
To configure a query parameter for code, the deep link of your Dynamic Link should look something similar to https://example.com/?code={CODE}

Sync data using Firebase and Ace Editor

After watching a demo on Firebase, I jumped in and tried to worked on an idea, collaboration on the same document. Turns out they already have Firepad as an example, but I still wanted to work on my own to better understand how Firebase works.
Using jQuery and Ace Editor, I'm able to create new documents but I find it hard to update once I started integrating Ace.
But then I'm getting an error from firebase.js
too many recursions
Changing the data on Firebase Forge automatically reflects on my page, but I cant seem to push my changes back to Firebase. Any ideas on how you'd pull this off?
--- EDIT---
Here's a sample code for a better view of what I'm working on.
var fileRef = new Firebase('https://user.firebaseio.com/document/body');
var editor = ace.edit("codepad");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/php");
fileRef.on('value', function(snapshot){
var file = snapshot.val();
editor.setValue(snapshot.val());
});
editor.getSession().on('change', function(e) {
fileRef.set(editor.getValue());
});

OpenSocial API stopped working in Google Calendar Gadget

I found out that opensocial API we were using in Calendar Sidebar Gadget stopped working. It was still working correctly on Friday. We were using opensocial to store and get some key-value data, and today we are getting error code: badRequest (with no error message) everytime we are trying to read anything.
This an example of the code we are using:
var idspec = opensocial.newIdSpec({ "userId" : "VIEWER", "groupId" : "SELF" });
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonAppDataRequest(idspec, "mydata"), "get_data");
req.send(function(data){console.log(data)});
And this is the response we are getting from google:
errorMessage_: undefined
globalError_: true
responseItems_: Object
get_data: opensocial.ResponseItem
data_: null
errorCode_: "badRequest"
errorMessage_: undefined
The code is quite simillar to what is described here: http://docs.opensocial.org/display/OSREF/App+Data
Does anyone have some similar problem, or know how to fix it? We are using it on our production system which is down since morning. any help would be appreciated.
The API has been deprecated. For solving this i changed the implementation for importing Google Contacts with Google oAuth 2.0 and its working fine with it.
https://developers.google.com/igoogle/docs/opensocial_rest_rpc ( deprecated one ).
For using Google oAuth 2.0 visit below link :-
https://developers.google.com/accounts/docs/OAuth2Login

Resources