@suro4ek/appmetrica-push-sdk 1.0.7 → 1.0.8

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.
@@ -32,21 +32,20 @@ class AppMetricaPushModule(reactContext: ReactApplicationContext) : ReactContext
32
32
  try {
33
33
  val debugMode = if (config.hasKey("debugMode")) config.getBoolean("debugMode") else false
34
34
 
35
- // ВАЖНО: AppMetricaPush.activate() должен быть вызван в MainApplication.onCreate()
36
- // Здесь мы только настраиваем канал уведомлений и проверяем статус
37
- // Если activate() не был вызван в Application, SDK выбросит исключение при попытке использования
38
-
35
+ // Инициализация AppMetrica Push
36
+ AppMetricaPush.activate(reactApplicationContext)
37
+
39
38
  // Настройка дефолтного канала AppMetrica Push SDK
40
39
  setupAppMetricaDefaultChannel()
41
-
40
+
42
41
  if (debugMode) {
43
- Log.d(TAG, "AppMetrica Push SDK ready (activated in MainApplication)")
42
+ Log.d(TAG, "AppMetrica Push initialized successfully")
44
43
  }
45
44
 
46
45
  promise.resolve(true)
47
46
  } catch (e: Exception) {
48
- Log.e(TAG, "Failed to initialize AppMetrica Push. Make sure AppMetricaPush.activate() was called in MainApplication.onCreate()", e)
49
- promise.reject("INIT_ERROR", "AppMetrica Push SDK is not activated. Add AppMetricaPush.activate(this) to MainApplication.onCreate()")
47
+ Log.e(TAG, "Failed to initialize AppMetrica Push", e)
48
+ promise.reject("INIT_ERROR", e.message)
50
49
  }
51
50
  }
52
51
 
@@ -174,4 +173,4 @@ class AppMetricaPushModule(reactContext: ReactApplicationContext) : ReactContext
174
173
  "4.2.1" // Fallback версия
175
174
  }
176
175
  }
177
- }
176
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suro4ek/appmetrica-push-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "React Native library for Yandex AppMetrica Push SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",