connectRequest abstract method

Future<ConnectResult> connectRequest(
  1. Install install,
  2. String email, {
  3. bool resendEmail = false,
  4. bool acceptPromoOffers = false,
  5. String lang = 'en',
  6. String apiKey,
  7. bool connectOnly = false,
})

Method called in order to link the installation to an account.

This method is asynchronous and executes server side. In order to activate feature(s) in the installation it's necessary to link the installation to an account. An account is recognized or created with only an email address. On first connection to an account, the method sends an email including a link to the email address received and clicking on the link will validate the account and link the installation. The email's link gives access to the app website where features can be activated for a specific installation. In website, a feature activation generates a token which must be bring back to the app installation in order to unblock the feature in the installation.

install is an instance of Install created by createInstall which represents the installation we want to link. email is the email address entered by the user, used to recognize or create the account to which the installation will be linked. resendEmail is optional and set to false by default, it's the possibility to resend the email of linking if we lost the previous one. acceptPromoOffers is optional and set to false by default, it's the possibility to receive promotional offers of the vendor's applications by email. lang is optional and set to english by default, it defines the language to use in website. apiKey is optional for testing but required for premium usage plan for production (ask PremiumPay Support) connectOnly is optional and default to false, when set to true and following the connect link from the email, there is no direct access to features. Returns ConnectStatus.SUCCESSFUL_CONNECT in ConnectResult.status if the installation has been linked to the account following email validation. Returns ConnectStatus.NEED_TO_VERIFY_EMAIL in ConnectResult.status if the user didn't click on the link in the email. Returns ConnectStatus.INVALID_APPLICATION_ID in ConnectResult.status if install contains an invalid app id.

Implementation

/// Returns [ConnectStatus.SUCCESSFUL_CONNECT] in [ConnectResult.status] if the installation has been linked to the account following email validation.
/// Returns [ConnectStatus.NEED_TO_VERIFY_EMAIL] in [ConnectResult.status] if the user didn't click on the link in the email.
/// Returns [ConnectStatus.INVALID_APPLICATION_ID] in [ConnectResult.status]  if [install] contains an invalid app id.
Future<ConnectResult> connectRequest(Install install, String email,
    {bool resendEmail = false,
    bool acceptPromoOffers = false,
    String lang = 'en',
    String apiKey,
    bool connectOnly = false});