line / flutter_line_sdk

A Flutter plugin that lets developers access LINE's native SDKs in Flutter apps with Dart.
https://developers.line.biz/
Apache License 2.0
213 stars 41 forks source link

SOS, how can I follow the merchant account in the App? We need to send the logistics information. #104

Open Pluto1219 opened 2 weeks ago

Pluto1219 commented 2 weeks ago

SOS, how can I follow the merchant account in the App? We need to send the logistics information. If I have any misunderstanding about flutter_line_sdk, please correct me, thank you very much.

Is it possible to provide a way to follow a business? For example,

void followBusinessAccount() async {
  final businessAccountID = 'BUSINESS_ACCOUNT_ID';

  try {
    final followResult = await LineSDK.instance.follow(
      accountID: businessAccountID,
    );

    if (followResult.isSuccess) {
      print('Successfully followed business account!');
      // Handle successful follow operation
    } else {
      print('Failed to follow business account: ${followResult.errorMessage}');
      // Handle follow failure
    }
  } on PlatformException catch (e) {
    print('Error following business account: ${e.message}');
    // Handle platform exceptions
  }
}
onevcat commented 2 weeks ago

The LINE SDK for Flutter project currently primarily provides features such as logging in using a LINE account. As far as I know, there is no public API available for performing arbitrary account follow operations at this time. This operation involves the core interests of user accounts. You can display an "Add Friend" button through some of the methods below and expect users to perform the operation themselves.

  1. When using the LINE SDK for Flutter, add the botPrompt setting when passing in LoginOption.

You can find the relevant documentation here: https://pub.dev/documentation/flutter_line_sdk/latest/flutter_line_sdk/LoginOption/botPrompt.html

  1. Use the LINE Social Plugin's Add friend feature to add a button to your webpage or application.

For more details, please refer to https://developers.line.biz/en/docs/line-social-plugins/install-guide/using-add-friend-buttons/#about