1.3.2 • Published 4 years ago
react-native-siam-piwat-indoormap v1.3.2
react-native-siam-piwat-indoormap
Getting started
$ npm install react-native-siam-piwat-indoormap@1.3.2 --save
OR
yarn add react-native-siam-piwat-indoormap@1.3.2
Mostly automatic installation
$ react-native link react-native-siam-piwat-indoormap@1.3.2
Note
For react-native@63.3
For iOS 11 or later
iOS
- Verify Podfile
pod 'SPWIndoormap', :path => '../node_modules/react-native-siam-piwat-indoormap/ios/RNIndoormap.podspec'
- Run
Pod install
- Add this code to
Appdelegate.m
Workaround
- dyld: Symbol not found or dyld: launch, loading dependent libraries
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
#import <RNIndoorMap/RNIndoorMap.h>
@implementation AppDelegate
- (instancetype)init
{
self = [super init];
if (self) {
[SPWIndoorMapManager initialSDKWithSlug:SPWApplicationIconSiam shops:@[]
language:SPWLanguageEnglish
appDelegate:[AppDelegate self]
isDebug:false simulateNavigation:false];
}
return self;
}
@end
Android
- Verify
compileSdkVersion = 29
- Add
mavenCentral()
tobuild.gradle
(in case of mising) - Add dependencies to
app/build.gradle
dependencies {
..
implementation 'io.github.smartsoftasia:indoormapsdk:0.9.12'
..
}
- Add this code to
MainApplication
file.
import com.siampiwat.indoormapsdk.IndoorMapSDK
override fun onCreate() {
super.onCreate()
IndoorMapSDK.init(this)
}
- Add this code to
MainActivity
// >>> import these <<<
import com.siampiwat.indoormapsdk.IndoorMapSDK
import com.siampiwat.indoormapsdk.data.appenum.SPWApplicationSlug
import com.siampiwat.indoormapsdk.data.appenum.SPWLanguage
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// >>> Add this method <<<
IndoorMapSDK.initialize(SPWApplicationSlug.ICON_SIAM, "", SPWLanguage.TH, true)
}
- Add activity to
AndroidMainifest.xml
<activity android:name="com.siampiwat.indoormap.IndoorMapView"/>
Usage
import {
presentIndoorMap,
getAllStores,
getVenues,
setOrigin,
setDestination,
setStores,
setFloorNumber,
resetOriginAndDestination
} from "react-native-siam-piwat-indoormap";
// set stores
setStores(<<shops (JSONArray)>>);
//get veunes
getVenues(() => {
// get stores
},
(err) => {},
);
// set floor number (Number: floor number 0 is G floor , -1 is B1)
setFloorNumber(<<floor number>>);
// set origin store
setOrigin(<<shop id>>);
// set destination store
setDestination(<<shop id>>);
// get all stores
getAllStores((result) => {
var stores = result;
});
// reset origin and destination
resetOriginAndDestination();
// present indoor map screen
presentIndoorMap();
Note
- You must set all stores before calling the getVenues method.
- You must get venues before presenting the indoor map screen.
- You should call the getVenues method only one time after setting all stores.
- Getting venues might return errors from the map provider, you need to get venues again in case of receiving an error.
1.3.2
4 years ago
1.3.1
4 years ago
1.2.8
4 years ago
1.2.7
4 years ago
1.2.6
4 years ago
1.2.2
4 years ago
1.3.0
4 years ago
1.2.9
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.1.2
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.2
4 years ago
1.0.4
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago