UNPKG

jcore-rn

Version:

极光 JCore SDK 的 React Native 封装,支持 Android 和 iOS (Fork of jcore-react-native)

39 lines (31 loc) 704 B
import { DeviceEventEmitter, NativeModules, Platform } from 'react-native' const JCoreModule = NativeModules.JCoreModule export default class JCore { static setAuth(auth) { JCoreModule.setAuth(auth) } static setCountryCode(params) { if (Platform.OS == "android") { JCoreModule.setCountryCode(params) } } static enableAutoWakeup(enable) { if (Platform.OS == "android") { JCoreModule.enableAutoWakeup(enable) } } static enableSDKLocalLog(params) { if (Platform.OS == "android") { JCoreModule.enableSDKLocalLog(params) } } static readNewLogs(callback) { if (Platform.OS == "android") { JCoreModule.readNewLogs(callback) } } }