diff --git a/lib/android/src/main/java/qiuxiang/amap3d/modules/SdkModule.kt b/lib/android/src/main/java/qiuxiang/amap3d/modules/SdkModule.kt index 97a5c1f2..1419fa76 100644 --- a/lib/android/src/main/java/qiuxiang/amap3d/modules/SdkModule.kt +++ b/lib/android/src/main/java/qiuxiang/amap3d/modules/SdkModule.kt @@ -14,7 +14,7 @@ class SdkModule(val context: ReactApplicationContext) : ReactContextBaseJavaModu } @ReactMethod - fun init(apiKey: String?) { + fun initSDK(apiKey: String?) { apiKey?.let { MapsInitializer.setApiKey(it) MapsInitializer.updatePrivacyAgree(context, true) @@ -28,4 +28,4 @@ class SdkModule(val context: ReactApplicationContext) : ReactContextBaseJavaModu fun getVersion(promise: Promise) { promise.resolve(MapsInitializer.getVersion()) } -} \ No newline at end of file +} diff --git a/lib/ios/Modules/OfflineModule.m b/lib/ios/Modules/OfflineModule.m deleted file mode 100644 index f057c8d0..00000000 --- a/lib/ios/Modules/OfflineModule.m +++ /dev/null @@ -1,13 +0,0 @@ -#import - -@interface RCT_EXTERN_MODULE(AMapOffline, NSObject) - -RCT_EXTERN_METHOD(download: (NSString)apiKey) -RCT_EXTERN_METHOD(addListener: (NSString)eventType) -RCT_EXTERN_METHOD(removeListeners: (int)count) - -- (NSArray *)supportedEvents { - return @[ @"download" ]; -} - -@end diff --git a/lib/ios/Modules/OfflineModule.swift b/lib/ios/Modules/OfflineModule.swift deleted file mode 100644 index 6a840bb5..00000000 --- a/lib/ios/Modules/OfflineModule.swift +++ /dev/null @@ -1,10 +0,0 @@ -@objc(AMapOffline) -class Offline: NSObject { - @objc static func requiresMainQueueSetup() -> Bool { - false - } - - @objc func removeListeners(_: Int) {} - @objc func addListener(_: String) {} - @objc func download(_: String) {} -} diff --git a/lib/ios/Modules/SdkModule.m b/lib/ios/Modules/SdkModule.m index 7f4de355..7206e76f 100644 --- a/lib/ios/Modules/SdkModule.m +++ b/lib/ios/Modules/SdkModule.m @@ -2,7 +2,7 @@ @interface RCT_EXTERN_MODULE(AMapSdk, NSObject) -RCT_EXTERN_METHOD(setApiKey: (NSString)apiKey) +RCT_EXTERN_METHOD(initSDK: (NSString)apiKey) RCT_EXTERN_METHOD(getVersion: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)_) @end diff --git a/lib/ios/Modules/SdkModule.swift b/lib/ios/Modules/SdkModule.swift index f00908f5..61d08069 100644 --- a/lib/ios/Modules/SdkModule.swift +++ b/lib/ios/Modules/SdkModule.swift @@ -4,7 +4,7 @@ class AMapSdk: NSObject { false } - @objc func setApiKey(_ apiKey: String) { + @objc func initSDK(_ apiKey: String) { AMapServices.shared().apiKey = apiKey } diff --git a/lib/src/sdk.ts b/lib/src/sdk.ts index 9e7f2ad8..05290f59 100644 --- a/lib/src/sdk.ts +++ b/lib/src/sdk.ts @@ -3,7 +3,7 @@ import { NativeModules } from "react-native"; const { AMapSdk } = NativeModules; export function init(apiKey?: string) { - AMapSdk.init(apiKey); + AMapSdk.initSDK(apiKey); } export function getVersion(): Promise {