@qafka/react-native-cms 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,7 +70,7 @@ class QafkaCmsPushModule(private val reactContext: ReactApplicationContext) :
70
70
  promise.resolve("granted")
71
71
  return
72
72
  }
73
- val activity = currentActivity
73
+ val activity = reactContext.currentActivity
74
74
  if (activity !is PermissionAwareActivity) {
75
75
  promise.reject(
76
76
  "NO_ACTIVITY",
@@ -88,12 +88,11 @@ class QafkaCmsPushModule(private val reactContext: ReactApplicationContext) :
88
88
 
89
89
  override fun onRequestPermissionsResult(
90
90
  requestCode: Int,
91
- permissions: Array<out String>?,
92
- grantResults: IntArray?,
91
+ permissions: Array<String>,
92
+ grantResults: IntArray,
93
93
  ): Boolean {
94
94
  if (requestCode != PERMISSION_REQUEST_CODE) return false
95
- val granted = grantResults != null &&
96
- grantResults.isNotEmpty() &&
95
+ val granted = grantResults.isNotEmpty() &&
97
96
  grantResults[0] == PackageManager.PERMISSION_GRANTED
98
97
  permissionPromise?.resolve(if (granted) "granted" else "denied")
99
98
  permissionPromise = null
@@ -113,7 +112,7 @@ class QafkaCmsPushModule(private val reactContext: ReactApplicationContext) :
113
112
  }
114
113
  try {
115
114
  val app = secondaryApp(androidConfig)
116
- FirebaseMessaging.getInstance(app).token.addOnCompleteListener { task ->
115
+ app.get(FirebaseMessaging::class.java).token.addOnCompleteListener { task ->
117
116
  if (task.isSuccessful) {
118
117
  promise.resolve(task.result)
119
118
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qafka/react-native-cms",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "QafkaCMS React Native runtime SDK — auth, content API, device attestation, secure storage, config-sync.",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",