This source is classified as deprecated. Use it for migration context and verify the supported replacement before new development.
This source is covered by a gated upgrade journey with candidate evidence, compatibility checks, parity proof, production acceptance, and rollback. Open InTouch React Native bridge lineage →
What this surface enables
A Mappls sdk for tracking telematics, workforce, gis analytics, identity platform across React Native.
The source identity names a provider-backed durable operations family whose records or lifecycle survive a single request or screen.
Authority: Source Identity · Evidence: intouchReact Native
Tracking TelematicsWorkforceGis AnalyticsIdentity Platform
GroovyTextJavaScript
Oauth2
Prepare the integration
- A React Native project with both native build environments
- OAuth client credentials issued for the intended Mappls project
Setup and usage examples
These examples were extracted from the canonical public source document and sanitized for credential-like values. Check the source branch and package version before copying into a production application.
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
+ maven { url 'https://maven.mapmyindia.com/repository/mapmyindia/'}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}Operate the whole lifecycle
This operational model supplements the repository-level setup instructions. Adapt its resource names and transitions to the owning product contract.
Create the owning project, enable entitlements, restrict credentials, and record the resource owner.
Create the SDK, session, asset, task, workspace, or other durable aggregate exactly once.
Persist provider and application identifiers and transitions; make commands idempotent and observations replayable.
Reconcile restarts, delayed events, expired credentials, partial sync, and version changes against durable evidence.
Revoke access and release runtime resources while preserving required history and audit evidence.
Topics documented by the source
01DEPRECATED
This repository is no longer in active development & use.
02Introduction
Get Real-Time Location Tracking for your apps with MapmyIndia InTouch SDK. Track a user's live location with our simplified InTouch React native SDK integration, highly customizable to your specific needs.
The InTouch SDK comes with a variety of events that enable better control and power over your tracking needs. Also get location benefits built for various applications including logistics, delivery tracking, employee tracking, and live location sharing.
To get started, explore the InTouch Demo App.
Already have an application which is build on React Native? Give it a boost with the powerful features of InTouch. Learn how to Integrate the InTouch SDK
• Setup: Please contact apisupport@mapmyindia.com to get the Intouch SDK authorization for your Client ID and Client Secret. - Quick Start: Start with a ready-to-go app - Integrate the SDK: Integrate the SDK into your app - Dashboard: See all your devices' locations on MapmyIndia InTouch Dashboard
03Setup
We use your Client ID to identify your account details and assign all your user's devices under a single account.
To get your Outh2 Rest API Client ID and Client Secret please login to MapmyIndia API Dashboard
Please contact apisupport@mapmyindia.com to get InTouch SDK access to your Client ID
After getting the access, you can start with the InTouchDemo app, or Integrate the InTouch SDK in your app.
04InTouchDemo app
This guide allows you to add live location tracking to your react native app. Visual Studio is the recommended development environment for building an app with the MapmyIndia InTouch React native SDK or you can use any other IDE.
05Step 1. Download the InTouchDemo App.
Click here to download the InTouchDemo App Project. Open this project in Visual Studio
06Step 2. Set your key
1. Add the Client Id and Client Secret to InputScreen.js file.
2. Run npm install
3. Run project on your device using simulator instance using below mentioned command line.
npx react-native run-android
07Getting started
Install the below mentioned library in your project.
npm install mapmyindia-intouch-react-native-sdk --save
• If using React-native<0.60 react-native link mapmyindia-intouch-react-native-sdk
08Installation
For Android and Ios add the below mentioned lines
09Android
• Add following line in android/build.gradle file:-
• Add following line in android/app/build.gradle file:-
10Note:
1. Java Version 11 Required 2. minimum compileSdkVersion 31 required
11IOS
• Add follwoing permissions in your project's plist.info
NSLocationAlwaysAndWhenInUseUsageDescription Your location is used to personalize content.
NSLocationAlwaysUsageDescription Your location is used to personalize content.
NSLocationWhenInUseUsageDescription Your location is used to personalize content.
NSMotionUsageDescription In order to count steps I need an access to your pedometer
UIBackgroundModes fetch location Add following function in your project's AppDelegate.h objectivec #import Add following function in your project's AppDelegate.m
12Step 3: Initialize Intouch SDK
Initialize the SDK with your Client ID and Client Secret and device name.Device name helps to identify the user on Portal.
13OR
Initialize the SDK with your Client ID , Client Secret , device name and deviceId. deviceId should be unique ID for every user. deviceId will be used to store the data against the particular user. deviceName will be used to identify the user on Portal
javascript MapmyIndiaIntouch.initializeWithDeviceId(deviceName,clientId,clientSecret,deviceId, (result) => { if (result === 'success') { //success } else { //error });
Note:This method can be used in case if your users uses two mobile phone. In this case, Both the mobile phone data will be pushed against the same deviceID. So ensure that before user logging into the new phone, logout the user from previous phone and call the stop tracking method. So that always tracking data will come from the single phone.
14Step 5. Start tracking
Track your app user's phone live location by using the below method.
You can start tracking using below three options
• MapmyIndiaIntouch.BEACONPRIORITYFAST - MapmyIndiaIntouch.BEACONPRIORITYOPTIMAL(default) - MapmyIndiaIntouch.BEACONPRIORITYSLOW javascript MapmyIndiaIntouch.startTracking(MapmyIndiaIntouch.BEACONPRIORITYOPTIMAL); Note: If no priority provided default will be used.
15OR
javascript MapmyIndiaIntouch.startTrackingWithCustomConfig({ standByTimeInMins: 1,//mandatory timeWhileMovingInSec: 10,//mandatory enableRequestPermissionIfMissing:true autoTrackingConfig: {endTimeConfig: {hour: 7, minute: 58, amPm: "pm"}} });
• timeWhileMovingInSec:(number) tracking api hit time while moving in seconds.
• standByTimeInMins:(number) tracking api hit time while standby in minutes.
16Only for android Platform
• enableRequestPermissionIfMissing(boolean) Location permissions will handle by SDK if set to true.Default value is true autoTrackingConfig(object): To set auto tracking settings: endTimeConfig(object): To set option to stop the tracking at time hour(number): To set hours (1-12) minute(number): To set minutes (0 - 59). Default value 0 second(number): To set seconds (0 - 59). Default is 0 amPm(String): am or pm. Default value is am
17Step 6. Stop tracking
To stop your app user's phone live location tracking use the below mentioned method.
18Step 7. Listen for tracking events
This method will be called when tracking starts, stops or some tracking error is caught.
19Step 8. Remove Listener
This method will remove TrackingStateListener. Call this method before Unmounting component.
20Step 9. getCurrentLocationUpdate
Updates single location on server and return to the user javascript try { const res= await MapmyIndiaIntouch.getCurrentLocationUpdate(); //do something with response } catch (e) { //error log } optional parameter(Android) enableRequestPermissionIfMissing(boolean) Location permissions will be handled by SDK if set to true.Default value is true.
Email us at apisupport@mapmyindia.com
Ask a question under the mapmyindia-api
Need support? contact us!
Read about the latest updates & customer stories
© Copyright 2022. CE Info Systems Ltd. All Rights Reserved. | Terms & Conditions
Service references found
URLs are sanitized during ingestion and may include documentation or legacy hosts. Use them to trace the source, not as a substitute for the current API contract.
https://github.com/MapmyIndia/mapmyindia-intouch-react-native-sdk#AddInTouchSDKhttps://github.com/MapmyIndia/mapmyindia-intouch-react-native-sdk#Setup):https://github.com/MapmyIndia/mapmyindia-intouch-react-native-sdk#intouchdemo-app):https://github.com/MapmyIndia/mapmyindia-intouch-react-native-sdk#IntegrateIntouchSDK):https://intouch.mapmyindia.com/nextgen):https://www.mapmyindia.com/api/dashboardhttps://code.visualstudio.com/?wt.mc_id=DX_841432https://github.com/MapmyIndia/mapmyindia-intouch-react-native-sdk/archive/main.ziphttps://intouch.mapmyindia.com/nextgenhttps://maven.mapmyindia.com/repository/mapmyindia/'%7Dhttps://stackoverflow.com/questions/tagged/mapmyindia-apihttps://www.mapmyindia.com/api/index.php#f_cont