状況説明
Flutterでアプリ制作をしており、firebase_dynamic_linksパッケージを使ってダイナミックリンクを導入しております。
iOS、androidについて、①未インストール、②インストール済&アプリ未起動、③インストール済&アプリ起動済のケースについて、ダイナミックリンクからのディープリンク起動をテストしております。
このテストの中で、唯一、androidの①未インストールのケースの時のみ、Google Play Storeにはジャンプするけど、インストールした後、ストアの「開く」ボタンを押してアプリを起動しても、ディープリンクが作動せずに困っております。
(そもそも、正常な動作では、「開く」ボタンが「続く」ボタンになっているはずなのですが・・)
実装の参考にしてるサイト
基本的に、下記ページを参考に設定・実装を行っております。
①パッケージのReadme
②ステップバイステップ
③dynamic linkの解釈
④androidのintent-filterの設定
怪しい場所① intent-filter
基本的に、他のテストは全て動作しているので、dynamic linkを受信してからの動作には問題ないと思っています。
なのでそもそも、ストアでdeep linkが切れているのではないかと。
そこで怪しいのは、上記④記事にある通り、intent-filterの設定ですね。
この記事を参考に下記のように実装しておりますが、何か間違いがあるのでしょうか??
ちなみに、android開発はやったことがないのでど素人レベルです。
(/android/app/src/main/AndroidManifest.xml)
<intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> <!-- ↓通知でアプリ起動のための設定 --> <intent-filter> <action android:name="FLUTTER_NOTIFICATION_CLICK" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <!-- ↓ダイナミックリンクからストアインストールからアプリ起動からディープリンク起動のための設定 --> <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="memorymate.page.link" android:scheme="https"/> </intent-filter> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:host="memorymate.page.link" android:scheme="http"/> <data android:host="memorymate.page.link" android:scheme="https"/> </intent-filter>
怪しい場所② dynamic linkの作成
可能性は少ないように思うのですが、link自体に何か間違いがあるのかなとも思うので、linkの生成コードを載せます。
final DynamicLinkParameters parameters = DynamicLinkParameters( uriPrefix: 'https://memorymate.page.link', link: Uri.parse('https://memorymate.page.link.com/?noteid=${widget.noteID}'), androidParameters: AndroidParameters( packageName: 'com.memorymate', ), iosParameters: IosParameters( bundleId: 'com.memorymate', appStoreId: '1537036392', ), socialMetaTagParameters: SocialMetaTagParameters( title: widget.noteTitle, description: widget.noteDescription, imageUrl: Uri.parse(widget.notePhotoURL != "" ? widget.notePhotoURL : "https://firebasestorage.googleapis.com/v0/b/memorymate-50732.appspot.com/o/profile%2Ficon_wide.png?alt=media&token=2ef0ecdb-fd75-4d55-a11b-61971227623c"), ), ); final Uri dynamicUrl = await parameters.buildUrl(); final ShortDynamicLink shortDynamicLink = await parameters.buildShortLink(); final Uri shortUrl = shortDynamicLink.shortUrl;
この最後のshortUrlをシェアしており、例えば、https://memorymate.page.link/7TNp2RkrsTD1qf8F9 が生成されたダイナミックリンクです。
よろしくお願いします。
私はFlutterでアプリ2作目のビギナーです。ネイティブ開発もやったことないです。
どんなヒントでもいいので、頂けたら嬉しいです!!
あなたの回答
tips
プレビュー