rn-kogo-ktm-sdk
v0.4.11
Published
KOGO SDK with ReactNative wrapper for KTM Pro-XP
Downloads
355
Maintainers
Readme
rn-kogo-ktm-sdk
KOGO SDK with ReactNative wrapper for KTM Pro-XP
Installation
npm install rn-kogo-ktm-sdk
or
yarn install rn-kogo-ktm-sdk
iOS integration
Open your project in XCode and open build settings for your project target
- Project -> Build Settings -> Set
Build Libraries for Distribution -> yes
In your project podfile, make sure use_frameworks!
is set
For initialization of RCT bridge in AppDelegate.mm
check the AppDelegate.mm example for reference
Add the below permission description to your info plist (if not added before)
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Your location is used to personalize content.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is used to personalize content.</string>
<key>NSMotionUsageDescription</key>
<string>KOGO needs device motion access for accuracy in tracking your trip when started</string>
<key>NSCameraUsageDescription</key>
<string>KOGO needs access to camera for creating new posts</string>
<key>NSMicrophoneUsageDescription</key>
<string>KOGO needs access to mic for KOGO AI voice recognition when accessed manually</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>KOGO needs access to mic for KOGO AI voice recognition when accessed manually</string>
After setting the above parameters, update your pods
cd ios
pod install
Android integration
In your android level build.gradle add the below code above plugins for addition of custom maven repo
allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
maven { url "https://jitpack.io" }
maven {
url 'https://maven.mappls.com/repository/mappls/'
}
maven{
name = "KTM-LIBRARY"
url = uri("https://maven.pkg.github.com/gauravkogo/ktm-library")
credentials {
username = "gauravkogo"
password = "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"
}
}
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
sync your project and then clean and rebuild.
Usage
import { KogoCommunityView } from "rn-kogo-ktm-sdk";
import { KogoAuthData, KogoCommunityView, analyticsEventData } from 'rn-kogo-ktm-sdk';
// ...
const analyticsEventCallBack = (eventData: analyticsEventData) => {
console.log('New event fired: ', eventData.key);
};
// ...
<View style={{flex: 1, backgroundColor: 'orange'}}>
<KogoCommunityView
userData={userDataObject}
analyticsEvent={analyticsEventCallBack}
/>
</View>
Please pass props as mentioned above to <KogoCommunityView />
as per prior communication with us.