Firebase Dynamic Links

Firebase Dynamic Links

0ef9d512061aa068aafd47c3e3f13ce0?s=128

Yuki Shiho

July 08, 2016
Tweet

Transcript

  1. 'JSFCBTF
 %ZOBNJD-JOLT ࢤำါل !TIJIPDIBO !ਆઘ'JSFCBTFษڧձ 

  2. "CPVUNF ࢤำါلʢ͠΄Ώ͏͖ʣ !TIJIPDIBO !TIJIPDIBOEFTV

  3. None
  4. *OUSPEVDUJPOPG'JSFCBTF%ZOBNJD-JOLT 'JSFCBTFͷͭΒΈ ŋТŋA "HFOEB

  5. ҟͳΔϓϥοτϑΥʔϜ্ͷίϯςϯπʹΞΫηε͢ ΔͨΊͷ63-Λఏڙ ΞϓϦͷΠϯετʔϧΛհͯ͠΋ΞϓϦॳճىಈ· ͰϦϯΫ৘ใ͕อ࣋͞ΕΔ ̍ͭͷϦϯΫͰϚϧνϓϥοτϑΥʔϜʢJ04  "OESPJE %FTLUPQBOE.PCJMFʣରԠ ίϯςϯπͷڞ༗ܦ࿏Λਖ਼֬ʹܭଌɾ෼ੳͯ͠αʔ ϏεάϩʔεΛՃ଎

    "CPVU%ZOBNJD-JOLTʢʣ
  6. "CPVU%ZOBNJD-JOLTʢʣ Doesn't have 
 your app installed,

  7. "CPVU%ZOBNJD-JOLTʢʣ Already have 
 your app installed,

  8. 8FC"QQ ιʔγϟϧɺϝʔϧͳͲʹΑΔϓϩϞʔγϣϯ ϢʔβʔUPϢʔβʔγΣΞ %FTLUPQ"QQ 23ίʔυͳͲʹΑΔϓϩϞʔγϣϯ 6TFDBTF

  9. %ZOBNJD-JOLTPO"OESPJEʢʣ 1. Add Firebase to your Android Project. buildscript {

    // ... dependencies { // ... classpath 'com.google.gms:google-services:3.0.0' } } root-level build.gradle file
  10. apply plugin: 'com.android.application' dependencies { // ... compile ‘com.google.firebase:firebase-core:9.2.0' compile

    'com.google.firebase:firebase-invites:9.2.0' } // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services' %ZOBNJD-JOLTPO"OESPJEʢʣ app/build.gradle file
  11. %ZOBNJD-JOLTPO"OESPJEʢʣ 2. In the Firebase console, open the 
 Dynamic

    Links section. Take note of 
 your project's Dynamic Links domain. domain looks like app_code.app.goo.gl
  12. %ZOBNJD-JOLTPO"OESPJEʢʣ 3. Create a Dynamic Link Create a Dynamic Link

    in the Firebase console
  13. -JOL/BNF  -JOL63-  "OESPJE"QQ  QBDLBHFOBNF  $VTUPN4DIFNFɿ-JOL63-ΑΓ΋༏ઌ͞ΕΔ 'BMMCBDLMJOLɿΞϓϦະΠϯετʔϧ࣌ͷભҠઌʢσ

    ϑΥϧτͰ͸ετΞʹભҠʣ .JOJNVNWFSTJPODPEF $VTUPNBQQMPDBUJPO %ZOBNJD-JOLTPO"OESPJEʢʣ
  14. %ZOBNJD-JOLTPO"OESPJEʢʣ 4. Create a Dynamic Link Create a Dynamic Link

    programmatically https://domain/?link=your_deep_link&apn=package_name
 [&amv=minimum_version][&ad=1][&al=android_link][&afl=fallback_link]
  15. EPNBJO  MJOL  BQO  QBDLBHFOBNF   BMɿ$VTUPN4DIFNF

    Bqɿ'BMMCBDLMJOL BNWɿ.JOJNVNWFSTJPODPEF VUN@TPVSDF VUN@NFEJVN VUN@DBNQBJHO  VUN@UFSN VUN@DPOUFOU HDMJE %ZOBNJD-JOLTPO"OESPJEʢʣ
  16. %ZOBNJD-JOLTPO"OESPJEʢʣ 5. Open Dynamic Links in your app you must

    add an intent filter to the activity 
 that handles deep links for your app <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:host="example.com" android:scheme="http"/> <data android:host="example.com" android:scheme="https"/> </intent-filter> AndroidManifest.xml
  17. %ZOBNJD-JOLTPO"OESPJEʢʣ 6. Handle deep links @Override protected void onCreate(Bundle savedInstanceState)

    { // ... // Build GoogleApiClient with AppInvite API for receiving deep links mGoogleApiClient = new GoogleApiClient.Builder(this) .enableAutoManage(this, this) .addApi(AppInvite.API) .build(); ***Activity.java
  18. %ZOBNJD-JOLTPO"OESPJEʢʣ AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false) .setResultCallback( new ResultCallback<AppInviteInvitationResult>() { @Override public

    void onResult(@NonNull AppInviteInvitationResult result) { if (result.getStatus().isSuccess()) { // Extract deep link from Intent Intent intent = result.getInvitationIntent(); String deepLink = AppInviteReferral.getDeepLink(intent); // Handle the deep link. For example, open the linked content } else { // no deep link found. } } }); } ***Activity.javaɹ
  19. 'JSFCBTFͷͭΒΈ ʅŋТŋA

  20. %ZOBNJD-JOLTΛ
 ϓϩάϥϜͰಈతʹ࡞੒ͨ͠৔߹ɺ ΫϦοΫ͕औΕͳ͍ɻ

  21. ৭ʑফͤͳ͍ɻ·ͣΞϓϦɻ

  22. http://stackoverflow.com/questions/37399681/how-to-delete-current-app-from- project-in-firebase “We don't yet have the ability to delete

    an app from the project. This is one of the features that should soon be available.”
  23. ৭ʑফͤͳ͍ɻ࣍ʹϦϯΫɻ

  24. ৭ʑফͤͳ͍ɻͦͯ͠ϓϩύςΟɻ

  25. compile ‘com.google.firebase:firebase-invites:9.2.0' ύοέʔδ໊ͳͲɻ 'PS%ZOBNJD-JOLT JOWJUFTʁʁʁ

  26. compile ‘com.google.android.gms:play-services-appindexing:9.2.0' ύοέʔδ໊ͳͲɻ 'PS"QQ*OEFYJOH 8IFSFJTpSFCBTFʁʁʁ

  27. 5IBOLT