flutter_naver_login 0.3.1

flutter_naver_login #

Build Status Build Status Build Status Build Status Build Status

A Flutter plugin for using the native Naver Login SDKs on Android and iOS.

AndroidX support #

Installation #

To get things up and running, you'll have to declare a pubspec dependency in your Flutter project. Also some minimal Android & iOS specific configuration must be done, otherise your app will crash.

On your Flutter project #

See the installation instructions on pub.

Android #

This assume that you have performed the "link app to package name and base class the Naver Login documentation for Android site.

Your Application Info is shown in the for Naver Developer Website.

Then find out what the Client ID is. The Naver Client ID can be found on the Naver App Dashboard from the Naver Developer Console.

Once you find out your Naver Client ID, URL Scheme and Set Package Name you'll have to do some things.

Then simply copy and paste into ROOT.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="client_id">[client_id]</string>
    <string name="client_secret">[client_secret]</string>
    <string name="client_name">[client_name]</string>
</resources>

 <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="flutter_naver_login_example"
        android:icon="@mipmap/ic_launcher">
        <meta-data
            android:name="com.naver.sdk.clientId"
            android:value="@string/client_id" />
        <meta-data
            android:name="com.naver.sdk.clientSecret"
            android:value="@string/client_secret" />
         <meta-data
            android:name="com.naver.sdk.clientName"
            android:value="@string/client_name" />
			...

A sample of the file can be found here. here.

Done!

iOS #

Cocoapod

pod install

This assumes that you've done the "Register and Configure Your App with Naver" step in the the Naver Login documentation for iOS site. (Note: you can skip "Step 2: Set up Your Development Environment").

After you've done that, find out what your Naver App Client ID is. You can find your Client ID, Client Secret, URL_SCHEME, in your Naver App's dashboard in the Naver developer.

    <key>LSApplicationQueriesSchemes</key>
   <array>
      <string>naversearchapp</string>
      <string>naversearchthirdlogin</string>
   </array>

	<key>kServiceAppUrlScheme</key>
	<string>[UrlScheme]</string>
	<key>kConsumerKey</key>
	<string>[ConsumerKey]</string>
	<key>kConsumerSecret</key>
	<string>[ConsumerSecret]</string>
	<key>kServiceAppName</key>
	<string>[ServiceAppName]</string>


   <key>NSAppTransportSecurity</key>
   <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
      <key>NSExceptionDomains</key>
      <dict>
         <key>naver.com</key>
         <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSIncludesSubdomains</key>
            <true/>
         </dict>
         <key>naver.net</key>
         <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSIncludesSubdomains</key>
            <true/>
         </dict>
      </dict>
   </dict>

A sample of a complete Info.plist file can be found here.

Done!

How do I use it? #

The library tries to closely match the native Android & iOS login SDK APIs where possible. For complete API documentation, just see the source code. Everything is documented there.

Since sample code is worth more than one page of documentation, here are the usual cases covered:

Getting the Naver acccount of a signed in user #

NaverLoginResult res = await FlutterNaverLogin.logIn();
setState(() {
    name = res.account.name;
});

The account variable will now contain the following information:

final String nickname;
final String id;
final String name;
final String email;
final String gender;
final String age;
final String birthday;
final String profileImage;

Getting the Naver currentAccessToken of a signed in user #

import 'package:flutter_naver_login/flutter_naver_login.dart';

NaverLoginResult res = await FlutterNaverLogin.logIn();
final NaverLoginResult result = await FlutterNaverLogin.logIn();
NaverAccessToken res = await FlutterNaverLogin.currentAccessToken;
setState(() {
   accesToken = res.accessToken;
   tokenType = res.tokenType;
});

ios issue #

  1. CocoaPods could not find compatible versions for pod "naveridlogin-sdk-ios" Specs satisfying the naveridlogin-sdk-ios (~> 4.0.12) dependency were found, but they required a higher minimum deployment target.
    • runner target - required a higher deployment target 10.0.
  2. d: warning: directory not found for option '-L/project directory' ld: library not found for -lflutter_naver_login clang: error: linker command failed with exit code 1 (use -v to see invocation)
    • build - clean - commandRun: flutter run
  3. Showing All Messages: Multiple commands produce '/Users/yoonjaepark/dev/my_app/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework':
  • file - project settings - build system - legacy build system

0.0.1 #

  • Initial release.

0.1.0 #

  • ios swift5 support.
  • readme add for ios cocoapods.
  • ios dependency Alamofire (5.0.0-beta.6) vesion update

0.1.1 #

  • pod spec change.

0.1.2 #

  • ios build issue list add readme.md

0.1.3 #

  • ios swift to object-c

0.2.0 #

  • ios issue add Readme.md

0.2.1 #

  • Readme.md

0.3.0 #

  • migrate to AndroidX

0.3.1 #

  • Android Login Cancle error fix

example/README.md

flutter_naver_login_example #

Demonstrates how to use the flutter_naver_login plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_naver_login: ^0.3.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_naver_login/flutter_naver_login.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
72
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
86
Learn more about scoring.

We analyzed this package on Jul 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

32 out of 32 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/flutter_naver_login.dart.

Run flutter format to format lib/flutter_naver_login.dart.

Format lib/src/clock.dart.

Run flutter format to format lib/src/clock.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test

Admin