flutter整合ios和android外掛
要整合我們的sdk
1.首先建立flutter_plugin,然後在ios Classes同級目錄下匯入Razer_IoT_SDK,同時在flutter_razer_plugin.podspec中配置
s.ios.vendored_frameworks = 'Frameworks/Razer_IoT_SDK.framework'
s.vendored_frameworks = 'Razer_IoT_SDK.framework'
##該pod依賴的系統library,多個用逗號隔開
s.frameworks = 'CoreBluetooth','Foundation'
s.libraries = 'c++'
然後在使用android studio執行,這樣ios會自動pod,然後使用Xcode執行在SwiftFlutterRazerPlugin中編寫ios外掛程式碼,這樣ios就完成了
2.安卓,不整合arr,將arr解壓後獲得jni,和 classess.jar包,解壓後的 AndroidManifest.xml檔案要同步拷貝過去,然後再build.gradle裡面配置,
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
main.jniLibs.srcDirs = ['libs/jni/']
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//Razer_Iot_SDK
implementation files('libs/classes.jar')
}
配置完成後,執行,ios和安卓外掛就完成了