Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 18507de

Browse files
author
Denny Beulen
committed
added dynamiclinks
1 parent 9799fd7 commit 18507de

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

firebase.android.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,4 +2098,28 @@ firebase.invites.getInvitation = function () {
20982098
});
20992099
};
21002100

2101+
//Dynamic links make sure invitations are enabled in the gradle file (it uses the same api)
2102+
(function() {
2103+
appModule.on("launch", function(args) {
2104+
var intent = args.android;
2105+
2106+
var getDynamicLinksCallback = new com.google.android.gms.tasks.OnCompleteListener({
2107+
onComplete: function(task) {
2108+
2109+
if (task.isSuccessful() && task.getResult() != null) {
2110+
result = firebase.toJsObject(task.getResult());
2111+
console.log("launched by dynamic link:"+ result);
2112+
} else {
2113+
console.log("Not launched by dynamic link");
2114+
}
2115+
}
2116+
});
2117+
2118+
firebaseDynamicLinks = com.google.firebase.dynamiclinks.FirebaseDynamicLinks.getInstance();
2119+
DynamicLinks = firebaseDynamicLinks.getDynamicLink(intent).addOnCompleteListener(getDynamicLinksCallback);
2120+
2121+
});
2122+
})()
2123+
2124+
21012125
module.exports = firebase;

0 commit comments

Comments
 (0)