All Projects → nrikiji → cordova-line-login-plugin

nrikiji / cordova-line-login-plugin

Licence: Apache-2.0 license
A cordova plugin for easy implementation of LINE login using LineSDK.

Programming Languages

java
68154 projects - #9 most used programming language
swift
15916 projects
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cordova-line-login-plugin

Unityionicintegration
A guide to integrating Unity 3D content into an Ionic app and sending messages between them (for Android & iOS)(tested with Vuforia plugin)
Stars: ✭ 94 (+370%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Wkwebview File Xhr
Cordova Plugin for WebView File XHR
Stars: ✭ 116 (+480%)
Mutual labels:  cordova, cordova-plugin
Cordova Broadcaster
Cordova Plugin to allow message exchange between javascript and native (and viceversa)
Stars: ✭ 104 (+420%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-purchases
Cordova in-app purchases and subscriptions made easy.
Stars: ✭ 52 (+160%)
Mutual labels:  cordova, cordova-plugin
JiaCordova
在Cordova及插件的基础上封装一些常用的功能,不断更新中
Stars: ✭ 35 (+75%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Remote Injection
DEPRECATED: Cordova plugin to allow a remote site to interact with cordova's javascript APIs when loaded within a cordova app.
Stars: ✭ 90 (+350%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Add Swift Support
🔨 Swiftify your Cordova app !
Stars: ✭ 108 (+440%)
Mutual labels:  cordova, cordova-plugin
Ionic4
This repo contains example code for ionic4. Get Step by Step tutorial of this repo examples using https://ampersandacademy.com/tutorials/ionic-framework-4
Stars: ✭ 37 (+85%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Fingerprint Aio
👆 📱 Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
Stars: ✭ 236 (+1080%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Touch Id
💅 👱‍♂️ Forget passwords, use a fingerprint scanner!
Stars: ✭ 209 (+945%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Stripe
A Cordova plugin that lets you use Stripe's Native SDKs for Android and iOS.
Stars: ✭ 90 (+350%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-android-window-background
Simple Cordova plugin to set Android window background on start-up 🎨 🍭
Stars: ✭ 15 (-25%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Wechat
A cordova plugin, a JS version of Wechat SDK
Stars: ✭ 1,198 (+5890%)
Mutual labels:  cordova, cordova-plugin
Google Analytics Plugin
Cordova Google Analytics Plugin for Android & iOS
Stars: ✭ 90 (+350%)
Mutual labels:  cordova, cordova-plugin
Blinkid Cordova
ID scanning for cross-platform apps built with Cordova and Phonegap.
Stars: ✭ 44 (+120%)
Mutual labels:  cordova, cordova-plugin
Wifiwizard2
A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+
Stars: ✭ 106 (+430%)
Mutual labels:  cordova, cordova-plugin
Awesome Cordova Plugins
A curated list of awesome Cordova Apache Plugins https://cordova.apache.org/plugins/
Stars: ✭ 33 (+65%)
Mutual labels:  cordova, cordova-plugin
Cl.kunder.webview
This cordova plugin enables you to open a second webview
Stars: ✭ 36 (+80%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Audioinput
This iOS/Android Cordova/PhoneGap plugin enables audio capture from the device microphone, by in near real-time forwarding audio to the web layer of your application. A typical usage scenario for this plugin would be to use the captured audio as source for a web audio node chain, where it then can be analyzed, manipulated and/or played.
Stars: ✭ 137 (+585%)
Mutual labels:  cordova, cordova-plugin
cordova-fonts
Cordova plugin for enumerating fonts on a mobile device
Stars: ✭ 14 (-30%)
Mutual labels:  cordova, cordova-plugin

cordova-line-login-plugin

A cordova plugin for easy implementation of LINE login using LineSDK.  

The function login, logs out, acquires, verifies, and refreshes the access token. The version of LineSDK you are using is as follows.

iOS:5.5.1
Android:5.3.1

cordova >= 7.1.0
cordova-ios >= 4.5.0
cordova-android >= 8.0.0

The flow until incorporation is as follows
Create a business account corresponding to LINE login from "LINE BUSINESS CENTER". Select NATIVE_APP for Application Type.

ios

  1. "IOS Bundle ID" "iOS Scheme" is set from "LINE DEVELOPERS".
  2. When using swift5, specify version in config.xml. (Default is swift4)
  3. Install this plugin
  4. Implementing the program
example)When using swift5
config.xml  
<platform name="ios">
  <preference name="UseSwiftLanguageVersion" value="5" />
</platform>

android

  1. "Android Package Name" "Android Package Signature" "Android Scheme" is set from "LINE DEVELOPERS"
  2. Install this plugin
  3. Implementing the program
example)  
Android Package Name : com.example.sample
Android Package Signature : 11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:gg:hh:ii:jj:kk
Android Scheme : com.example.sample://

Requirement

https://github.com/akofman/cordova-plugin-add-swift-support

Installation

cordova plugin add cordova-line-login-plugin

Supported Platforms

  • iOS
  • Android

LINE SDK

This plugin use the SDKs provided by LINE. More information about these in their documentation for iOS or Android

Usage

Example

document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {
  lineLogin.initialize({channel_id: "1565553788"});
}

function onLineLogin() {
  // login...
  lineLogin.login(
   function(result) {
     console.log(result); // {userID:12345, displayName:'user name', pictureURL:'thumbnail url'}
   }, function(error) {
     console.log(error);
   });
}

function onLineLoginWeb {
  // login with web...(iOS only)
  lineLogin.loginWeb(
    function(result) {
      console.log(result); // {userID:12345, displayName:'user name', pictureURL:'thumbnail url'}
    }, function(error) {
      console.log(error);
    });
}

function onLineLogout {
  // logout...
  lineLogin.logout(
    function(result) {
      console.log(result);
    }, function(error) {
      console.log(error);
    });
}

function onLineGetAccessToken() {
  // get access token
  lineLogin.getAccessToken(
    function(result) {
      // success
      console.log(result); // {accessToken:'xxxxxxxx', expireTime: 123456789}
    }, function(error) {
      // failed
    });
}

function onLineVerifyAccessToken() {
  // verify current access token
  lineLogin.verifyAccessToken(
    function() {
      // success
    }, function(error) {
      // failed
    });
}

function onLineRefreshAccessToken() {
  // refresh access token
  lineLogin.verifyAccessToken(
    function(accessToken) {
      // success
    }, function(error) {
      // failed
    });
}

If you want to use it with ionic, please refer to the ionic-native documentation.

Error Code

error callback returns an error of the form  

{
  code: -1: Invalid parameter, -2:SDK returned an error, -3: Unknown error
  sdkErrorCode: Error code returned by SDK
  description: Error message
}

use in capacitors

install

$ npm install cordova-line-login-plugin

iOS configuration

Overwrite AppDelegate and info.plist in capcitor or add value Please take the following actions as I have not found a way to do so.
Please note that you will have to deal with this every time you recreate the ios directory.

In file ios/App/App/AppDelegate.swift add or replace the following:

+ import LineSDK
  [...]
   func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
-   return CAPBridge.handleOpenUrl(url, options)
+     if CAPBridge.handleOpenUrl(url, options) {
+        return LoginManager.shared.application(app, open: url)
+     } else {
+         return false
+     }
   }

Add the following in the ios/App/App/info.plist file:

+ <key>CFBundleURLTypes</key>
+ <array>
+     <dict>
+         <key>CFBundleTypeRole</key>
+         <string>Editor</string>
+         <key>CFBundleURLSchemes</key>
+         <array>
+             <string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+         </array>
+     </dict>
+ </array>
+ <key>LSApplicationQueriesSchemes</key>
+ <array>
+     <string>lineauth2</string>
+ </array>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].