line_sample_app

 

Table of contents


 

Introduction


This explanation assumes that the i-PRO camera application development environment has been completed.
If you are not ready to build the development environment, please refer to here to complete it.

Also, in this tutorial, the SDK installation directory is described as ${SDK_DIR}.

Operation overview


line_sample_app is a sample application that sends messages to LINE on mobile phones.

Building apps that use LINE, including line_sample_app, is not supported. Please refer to the information provided in this chapter when building. Please note that we cannot provide support even if you contact us.

 

External libraries required for operation


To build with C/C++, need below:

libcurl

OpenSSL

The use of external libraries will be explained later.

 

Directory path of the sample app


The C/C++ source code is stored below.

${SDK_DIR}/src/adamapp/line_sample_app

No Python source code.

 

How to build the sample app (C/C++)


Send a message to LINE using LINE Notify or Messaging API.
Both text message and image massage can be sent by LINE Notify.
Only text message can be sent by Messaging API.

・LINE Notify and Messaging API are not i-PRO services. Please make your own arrangements.

・When sending image messages, a camera that can insert an SD card is required.

Build libcurl and OpenSSL and copy the library and header files to the line_sample_app folder. See here for building with C/C++.

 

How to use the sample app


■Preparation

Prepare to check the operation.

  1. Connect to LAN that allows you to connect LINE server and the camera to which the app is installed.

  2. Create a LINE account.

  3. Set LINE service to be used in "LINE Service" of AppPref; choose either LINE Notify or Messaging API.

 

[Using LINE Notify]

Issue access token for LINE Notify

・Log in to LINE Notify homepage (https://notify-bot.line.me/ja/) using the LINE account.
・Open my page from the pull-down menu by pressing the username shown on the right top of the display.

・Issue an access token: go to Issue access token (for developers), then choose Issue token, input token name. LINE Notify appears as your friend in your LINE account once the token is issued
・Set the issued access token as "LINE Notify Access Token " in the AppPref.

 

[Using Messaging API]

Issue and setup an access token for Messaging API.

・Both long-term and short-term tokens are applicable.
User specific token is not recommended since the issuing process is not as simple as the other tokens. Long-term access token: Go to LINE Developers console. Choose a channel from [Channel setting]. Issue a channel access token from [Messaging API setting] tab. Short-term access token: Go to Messaging API reference (https://developers.line.biz/ja/reference/messaging-api/#issue-shortlived-channel-access-token).
・Set the issued access token as "LINE Notify Access Token " in the AppPref.
・You can confirm your user ID from [Channel basic setting] tab of LINE Developers console.
・Set the user ID as "Messaging API User ID" in AppPref.

 

■Execution

Start the line_sample_app and send a text message or send an image message.

  1. Send a text message (LINE Notify/Messaging API)
    Input message in "Send Text Message to LINE:" space and press "Send Text Message". "send message OK:" along with the message you sent will appear at the bottom of app's GUI when the message is successfully sent.

  2. Send an image message (LINE Notify)
    Place the image file you want to send under SD card folder. Input name of the image file in "Send image Message to LINE:" space and press "Send image Message". "send image OK:" along with the name of the image file you sent will appear at the bottom of app's GUI when the message is successfully sent.