buildLongAppLinking method

Future<LongAppLinking> buildLongAppLinking(
  1. ApplinkingInfo applinkingInfo
)

Asynchronously generates a long link.

This method returns a Future that resolves to a LongAppLinking object, which contains the long app link of App Linking.

The applinkingInfo parameter is an AppLinkingWithInfo object that specifies the information to be contained in the app link, such as the deep link, the social card, the campaign parameters, etc.

Example usage:

try {
  LongAppLinking longAppLinking = await agcAppLinking.buildLongAppLinking(appLinkingInfo);
  print(longAppLinking.longLink.toString());
  _showDialogLong(context, longAppLinking);
} on PlatformException catch (e) {
  _showDialog(context, e.toString());
}

@param applinkingInfo The information to be contained in the app link.

@return A Future that resolves to a LongAppLinking object.

Implementation

Future<LongAppLinking> buildLongAppLinking(
    ApplinkingInfo applinkingInfo) async {
  try {
    LongAppLinking appLinking = LongAppLinking.fromMap(await _channel
        .invokeMethod('buildLongAppLinking', applinkingInfo.toMap()));
    return appLinking;
  } catch (e) {
    throw AppLinkingException.from(e);
  }
}