package com.smartechpushreactnative import com.facebook.react.bridge.* import com.facebook.react.module.annotations.ReactModule class SmartechPushReactNativeModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { private val smartechPushReactNativeImpl = SmartechPushReactNativeImpl(reactContext) override fun getName(): String { return smartechPushReactNativeImpl.getName() } override fun getConstants(): MutableMap { return smartechPushReactNativeImpl.getConstants() } @ReactMethod fun getTypedExportedConstants(): MutableMap { return smartechPushReactNativeImpl.getConstants() } @ReactMethod fun optPushNotification(value: Boolean) { try { smartechPushReactNativeImpl.optPushNotification(value) } catch (e: Throwable) { e.printStackTrace() } } @ReactMethod fun hasOptedPushNotification(callback: Callback?) { smartechPushReactNativeImpl.hasOptedPushNotification(callback) } @ReactMethod fun getDevicePushToken(callback: Callback?) { smartechPushReactNativeImpl.getDevicePushToken(callback) } @ReactMethod fun setDevicePushToken(token: String?) { smartechPushReactNativeImpl.setDevicePushToken(token) } @ReactMethod fun handlePushNotification(notificationData: String, callback: Callback?) { smartechPushReactNativeImpl.handlePushNotification(notificationData, callback) } @ReactMethod fun requestNotificationPermission(callback: Callback?) { smartechPushReactNativeImpl.requestNotificationPermission(callback) } @ReactMethod fun updateNotificationPermission(pnPermissionStatus: Double) { smartechPushReactNativeImpl.updateNotificationPermission(pnPermissionStatus) } @ReactMethod fun registerForPushNotificationWithAuthorizationOptions( alert: Boolean, badge: Boolean, sound: Boolean ) { smartechPushReactNativeImpl.registerForPushNotificationWithAuthorizationOptions( alert, badge, sound ) } @ReactMethod fun addListener(eventName: String) { } @ReactMethod fun removeListeners(count: Double) { } }