3

I have a flutter based mobile app and firebase dynamic link integration for Google Play and Apple App Store. I want to set rules for my firebase dynamic link redirection. To make clear:

  • If a user came to firebase dynamic links on Huawei brand android mobile device, he will be redirected to Huawei AppGalery.

  • If a user came to firebase dynamic links on different brand mobile devices, he will be redirected to Google PlayStore.

I could not find a solution to this in Firebase. Is it possible to make this redirection with Firebase dynamic link?

  • Currently, Flutter does not support the App Linking Service. It is in development roadmap. I’ll update you once I learn more about the issue. – zhangxaochen Aug 21 '20 at 09:34

2 Answers2

0

Firebase Dynamic Links cannot work on Huawei phones without GMS. GMS will be called for redirecting to the link. So if there is no GMS, redirection to the link cannot be processed.

You can use App Linking on Huawei devices. The App Linking service provides the App Linking SDK. You must integrate the SDK into your app before your app can create and receive links of App Linking.

  • How to integrate the App Linking SDK
  1. Integrating the AppGallery Connect SDK: Integrate the AppGallery Connect SDK and plug-in before integrating the App Linking SDK into your app
  2. Enabling the App Linking Service
    1. Sign in to AppGallery Connect and select My projects.
    2. Find your project from the project list and click the app for which you need to enable App Linking on the project card.
    3. Go to Growing > App Linking. On the App Linking page that is displayed, click Enable now.
  3. Integrating HUAWEI Analytics Kit: To collect statistics on App Linking events, you need to use HUAWEI Analytics Kit.
  4. Integrating the App Linking SDK
  • Android Studio

Add the following code to the build.gradle file in the app directory (usually app/build.gradle) to integrate the App Linking SDK:

implementation 'com.huawei.agconnect:agconnect-applinking:1.4.0.300'
  • Eclipse

Configure the following dependencies when using the aar2eclipse tool to convert your package into an AAR package:

dependencies { 
    embed "com.huawei.agconnect:agconnect-applinking:1.4.0.300" 
}

After the App Linking SDK is integrated, you can create links of App Linking in AppGallery Connect or in your app.

Similar question: Is it possible to implement Firebase Dynamic Links on Huawei devices?

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • This does not consider that he is using Flutter. In order to implement your proposed solution you would first have to set up method channels for the SDK because Huawei does not provide an easy to integrate plugin just yet. – devEnju Aug 19 '20 at 07:44
  • Yes, currently, Flutter does not support the App Linking Service. – zhangxaochen Aug 21 '20 at 09:39
0

I think the aim is to first decide if you are on a device that supports Google Play Services, or a device that supports Huawei.

When decided and on Huawei, link app gallery connect, you can use Huawei remote config.

Sign up for the Huawei console https://developer.huawei.com/consumer/en/agconnect/remote-configuration/

Dependencies:

implementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.5.2.300'
implementation 'com.huawei.hms:hianalytics:6.0.0.300'

Fetch the config, that perhaps you mirror to Firebase:

config = AGConnectConfig.getInstance()
config.fetch(0) // a value of 0 here is for DEBUGGING ONLY, delete for prod (giving a 12 hour refresh period)
    .addOnSuccessListener {
        config.apply(it)
        Log.d(TAG, "Applied")
        //update based on RemoteConfig
    }

Ref: https://blog.blundellapps.co.uk/remote-configuration-using-appgallery-connect/

Blundell
  • 75,855
  • 30
  • 208
  • 233