GithubHelp home page GithubHelp logo

yaiio / cordova-line-login-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nrikiji/cordova-line-login-plugin

0.0 2.0 0.0 5.45 MB

LineSDKを使用してLINEログインを簡単に実装するためのcordovaプラグイン。

Java 11.65% Objective-C 73.00% Swift 12.68% JavaScript 2.66%

cordova-line-login-plugin's Introduction

cordova-line-login-plugin

LineSDKを使用してLINEログインを簡単に実装するためのcordovaプラグイン。  

機能はログインのみで、使用しているLineSDKのバージョンは以下のとおり。

iOS:4.1.0

Android:4.0.8

組み込みまでの流れは以下の通り
「LINE BUSINESS CENTER」からLINEログインに対応したビジネスアカウントを作成。Application TypeはNATIVE_APPを選択。

ios

  1. 「LINE DEVELOPERS」より「iOS Bundle ID」「iOS Scheme」を設定。
  2. 当プラグインをインストール。
  3. xcodeの「Capabilities」より「Keychain Sharing」をONに設定。
  4. プログラムの実装
例)
iOS Bundle ID : com.example.sample
iOS Scheme : line3rdp.com.example.sample

android

  1. 「LINE DEVELOPERS」より「Android Package Name」「Android Package Signature」「Android Scheme」を設定。
  2. 当プラグインをインストール。
  3. プログラムの実装
例)  
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://

Installation

cordova plugin add https://github.com/nrikiji/cordova-line-login-plugin.git --variable LINE_CHANNEL_ID={your_line_channel_id}

Supported Platforms

  • iOS
  • Android

Example

ionicでの使用例

angular.module('starter', ['ionic'])
  .run(function($ionicPlatform) {
    ・・・

    // initialize
    lineLogin.initialize({channel_id: "your_chanel_id"});
  })
  .controller("LineCtrl", function($scope) {
    $scope.onLineLogin = function() {
      // login...
      lineLogin.login({},
        function(result) {
          console.log(result); // {userID:12345, displayName:'user name', pictureURL:'thumbnail url'}
        }, function(error) {
          console.log(error);
        });
    }

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

    $scope.onLineGetAccessToken = function() {
      // get access token
      lineLogin.getAccessToken(
        function(accessToken) {
          // success
        }, function() {
          // failed
        });
    }

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

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

  });

cordova-line-login-plugin's People

Contributors

nrikiji avatar

Watchers

James Cloos avatar Sanguansak Petchmeesri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.