jeduan / cordova-plugin-facebook4

Use the latest Facebook SDK in your Cordova and Ionic projects
Other
767 stars 511 forks source link

getDeferredApplink return appLinkData is empty #868

Closed Fabien244 closed 2 years ago

Fabien244 commented 4 years ago

We connect a deeplink FB, but we get an empty test result. appLinkData is Empty

AppLinkData.fetchDeferredAppLinkData(cordova.getActivity().getApplicationContext(), new AppLinkData.CompletionHandler() { @Override public void onDeferredAppLinkDataFetched( AppLinkData appLinkData) { PluginResult pr; if (appLinkData == null) { pr = new PluginResult(PluginResult.Status.OK, ""); } else { pr = new PluginResult(PluginResult.Status.OK, appLinkData.getTargetUri().toString()); } callbackContext.sendPluginResult(pr); return; } });

matheusmdias commented 4 years ago

I'm running into the same issue. When trying to retrieve data from deeplink, it returns an empty string for me ("")

Anyone have any news about that?

onyet commented 3 years ago

Until now, we still haven't found the answer. 2021

facebookSDK() {
    this.fb.getDeferredApplink().then((val) => {
      this.alert.create({
        header: 'Get Deferred App Link',
        message: JSON.stringify(val),
        buttons: [
          {
            text: 'Ok, This is Sample!',
            role: 'cancle'
          }
        ]
      }).then(a => a.present());
    }, (error) => {
      this.alert.create({
        header: 'Get Error Deferred App Link',
        message: JSON.stringify(error),
        buttons: [
          {
            text: 'Ok, This is Sample!',
            role: 'cancle'
          }
        ]
      }).then(a => a.present());
    });
    this.fb.logEvent(this.fb.EVENTS.EVENT_NAME_ADDED_TO_CART);
  }
noahcooper commented 2 years ago

This plugin is deprecated. Check out cordova-plugin-facebook-connect at https://www.npmjs.com/package/cordova-plugin-facebook-connect.

To use the getDeferredApplink method on iOS, you must use a plugin such as cordova-plugin-idfa to request ad tracking permission.

For example:

cordova.plugins.idfa.requestPermission().then(function() {
  facebookConnectPlugin.setAdvertiserTrackingEnabled(true);
  facebookConnectPlugin.getDeferredApplink(function(url) {
    console.log('url = ' + url);
  });
});

On Android, no additional plugin is required.