AppsFlyerSDK / appsflyer-flutter-plugin

Flutter Plugin for AppsFlyer SDK
MIT License
150 stars 120 forks source link

How to listen the OnDeepLinking callback method #252

Open kalyanchandra48 opened 1 year ago

kalyanchandra48 commented 1 year ago

How to listen the deeplink data callback is not returning any data

github-actions[bot] commented 1 year ago

👋 Hi @kalyanchandra48 and Thank you for reaching out to us. In order for us to provide optimal support, please submit a ticket to our support team at support@appsflyer.com. When submitting the ticket, please specify:

muriloformiga commented 1 year ago

HI @kalyanchandra48

I solved it by changing the order for initialization and onDeepLink callback:

_appsFlyer.onDeepLinking(
  (result) {
    ...
  },
);

await _appsFlyer.initSdk(
  registerConversionDataCallback: true,
  registerOnDeepLinkingCallback: true,
);

It makes no sense, but it works!

kalyanchandra48 commented 1 year ago

Yeah For Android it's Working. Ios is not working Can you have any suggestions or example code for ios in flutter

On Fri, Mar 31, 2023 at 1:20 AM Murilo Formiga @.***> wrote:

HI @kalyanchandra48 https://github.com/kalyanchandra48

I solved it by changing the order for initialization and onDeepLink callback:

_appsFlyer.onDeepLinking( (result) { ... }, ); await _appsFlyer.initSdk( registerConversionDataCallback: true, registerOnDeepLinkingCallback: true, );

It makes no sense, but it works!

— Reply to this email directly, view it on GitHub https://github.com/AppsFlyerSDK/appsflyer-flutter-plugin/issues/252#issuecomment-1490855514, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATKEMT52H46KGHJCSFXBDPDW6XPZ5ANCNFSM6AAAAAAVUUNKXY . You are receiving this because you were mentioned.Message ID: @.***>

-- KALYAN CHANDRA MOB : 9490533901

muriloformiga commented 1 year ago

Hello again @kalyanchandra48

I just did what I told you and it worked for Android and iOS. Did you follow this guide to configure the iOS Universal Links?

Once you did that, on the Flutter side, you can just:

Future<void> start() async {
  final appsFlyerOptions = AppsFlyerOptions(
    afDevKey: 'yourDevKey',
    appId: '0000000000',
    showDebug: kDebugMode,
    timeToWaitForATTUserAuthorization: 60,
    appInviteOneLink: '0000',
  );
  _appsFlyer = AppsflyerSdk(appsFlyerOptions);
  _appsFlyer.onDeepLinking(
    (result) {
      print(result);
    },
  );
  await _appsFlyer.initSdk(
    registerConversionDataCallback: true,
    registerOnDeepLinkingCallback: true,
  );
}

I call it on my splash screen, while loading all other resources. Remember that you must add the appId in order to make your app works on iOS.

kalyanchandra48 commented 1 year ago

It worked. Can you share any link of GitHub source code? Link.?

On Fri, Mar 31, 2023, 11:52 PM Murilo Formiga @.***> wrote:

Hello again @kalyanchandra48 https://github.com/kalyanchandra48

I just did what I told you and it worked for Android and iOS. Did you follow this guide https://dev.appsflyer.com/hc/docs/dl_ios_init_setup to configure the iOS Universal Links?

Once you did that, on the Flutter side, you can just:

Future start() async { final appsFlyerOptions = AppsFlyerOptions( afDevKey: 'yourDevKey', appId: '0000000000', showDebug: kDebugMode, timeToWaitForATTUserAuthorization: 60, appInviteOneLink: '0000', ); _appsFlyer = AppsflyerSdk(appsFlyerOptions); _appsFlyer.onDeepLinking( (result) { print(result); }, ); await _appsFlyer.initSdk( registerConversionDataCallback: true, registerOnDeepLinkingCallback: true, ); }

I call it on my splash screen, while loading all other resources. Remember that you must add the appId in order to make your app works on iOS.

— Reply to this email directly, view it on GitHub https://github.com/AppsFlyerSDK/appsflyer-flutter-plugin/issues/252#issuecomment-1492412437, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATKEMT5H7EXEAC2KKXIUMYDW64OEXANCNFSM6AAAAAAVUUNKXY . You are receiving this because you were mentioned.Message ID: @.***>