Skip to content

TTLock is a global provider of solutions for smart locks. We provide PCBA and softwares for lock manufactures and end users. We provide open API/SDK for developers. With these APIs/SDKs, you can develop your own applications to manage smart locks. The SDK here is for mobile app to communicate with locks via bluetooth.

Notifications You must be signed in to change notification settings

ttlock/ReactNative-Demo-Deprecated

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 

Repository files navigation

Note: The demo has been deprecated. The new plugin and demo https://github.com/ttlock/react-native-ttlock

react-native-ttlock

Developers Email list

[email protected]

install and link lib

  1. $ npm install [email protected] --save

  2. $ react-native link react-native-ttlock

add configuration to project

iOS

  1. In XCode,Add KeyPrivacy - Bluetooth Peripheral Usage Description Value your description for bluetooth to your project's infoCustom iOS Target Projectes
  2. Run your project (Cmd+R)<

Note: If you have installed versions before 1.0.4,please remove TTLock.framework in XCode

Android

  1. config repositories in android/build.gradle:
allprojects {
    repositories {
    
      flatDir{
         dirs "$rootDir/../node_modules/react-native-ttlock/android/libs"
      }
    }
}

2.Add permission

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

3.Add service

<service android:name="com.ttlock.bl.sdk.service.BluetoothLeService" />

Use module in Project App.js

 import TtLockModule from 'react-native-ttlock';

 TtLockModule.initTTlockApi(uid)

About

TTLock is a global provider of solutions for smart locks. We provide PCBA and softwares for lock manufactures and end users. We provide open API/SDK for developers. With these APIs/SDKs, you can develop your own applications to manage smart locks. The SDK here is for mobile app to communicate with locks via bluetooth.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published