yandex_sign 0.9.2

yandex_sign #

Flutter plugin for yandex map sign and yandex navigator sign.

Disclaimer: This project uses Yandex sign algorithm which discribed in commercial_use_signature_navigator and commercial_use_signature_yandexmaps

Getting Started #

Generate your API Key #

Get key and client Id from yandex_navigator or yandexmaps

Initilazing for IOS #

  1. Convert key.pem file to key.der file with openssl $ openssl rsa -in key.pem -out key.der -outform DER
  2. Add file key.der to ios project Bundle example

Initilazing for Android #

  1. Get String(base64) from file key.pem
  2. Add to local variable for flutter project like in example

Usage #

Example:

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:yandex_sign/yandex_sign.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _signUrl = 'Unknown';


  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  Future<void> initPlatformState() async {
    String signUrl;
    try {
      final url = 'yandexnavi://build_route_on_map?lat_to=55.70500&lon_to=37.587200&client=007';
      final androidKey = '''-----BEGIN RSA PRIVATE KEY-----
MIIBOgIBAAJBALUwoxjKUZtMiFPe1K4XAPDYZCX1b6wOM8UXeGS5EbsJe/h12VM1
asx9rtVXJ1Kwhb1N7KcSFc1l9wl2gqe1f8cCAwEAAQJAGV0Dl7bKkai29LaeovgJ
Y62G52FiDn22dYKBkefuOXYwFBSD6+pbHby3m5oBEy51aZJ+QQBIv+RjHN1h1aUQ
8QIhAN9hr9dxgzKYw8FUQBZ4qgd6hRSjb/ryfjgiF5qPt2FbAiEAz6XFDvwkbwE5
FLrO8MigLVXuEuhiCsbkwn8aobBUGwUCIBGlTNeu/tcrXCNUfW+I/p1ynzqfIoRn
TXMvtj+eZLULAiB/n4s2YpKiB0ZmD0sRgr2wH5hr1pgrt4LyZ9yedBm9YQIhAMIB
oRxLAAcDDIlC6vDrYk94nCT0OQ6ZH2YK3rxu8iyy
-----END RSA PRIVATE KEY-----
''';
      final iosNameOfDerFile = 'private_key';
      //Sign url for both android & ios with key
      signUrl = await YandexSign.getSignUrl(url, androidKey, iosNameOfDerFile);
    } on PlatformException {
      signUrl = 'Failed to get platform version.';
    }
    
    if (!mounted) return;

    setState(() {
      _signUrl = signUrl;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_signUrl\n'),
        ),
      ),
    );
  }
}

For more info see example

Features #

  • [X] iOS Support
  • [X] Android Support

0.9.2 #

  • reformat change log
  • add readme

0.9.1 #

  • fix the Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher. Project 'yandex_sign' is using version 1.2.75.
  • fix the bug with overriding android minSdkVersion in AndroidManifest.xml in android packege of plugin

0.9.0 #

  • Add plugin to github and publish.

example/README.md

yandex_sign_example #

Demonstrates how to use the yandex_sign 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:
  yandex_sign: ^0.9.2

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:yandex_sign/yandex_sign.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
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]
64
Learn more about scoring.

We analyzed this package on Aug 16, 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.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 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/yandex_sign.dart.

Run flutter format to format lib/yandex_sign.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 1.14.12
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