apps-sdk 2.0.6 → 2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Apps SDK - Compatible with Expo SDK 54 + React 19",
5
5
  "main": "index.js",
6
6
  "author": "ASD",
@@ -199,6 +199,15 @@ class Adapty {
199
199
  }
200
200
  }
201
201
 
202
+ async setFirebaseIntegrationIdentifier(integrationIdentifier) {
203
+ try {
204
+ await adapty.setIntegrationIdentifier('firebase_app_instance_id', integrationIdentifier);
205
+ config.DEBUG_MODE && console.log('Adapty Firebase integration identifier set successfully:', integrationIdentifier);
206
+ } catch (error) {
207
+ console.error('Error setting Firebase integration identifier:', error);
208
+ }
209
+ }
210
+
202
211
  async getOnboardingForPlacement(placementID, lang) {
203
212
  try {
204
213
  return await adapty.getOnboarding(placementID, lang);
@@ -0,0 +1,53 @@
1
+ import analytics from '@react-native-firebase/analytics';
2
+ import config from '../../config';
3
+
4
+ class Firebase {
5
+ async initialize() {
6
+ try {
7
+ // Firebase should already be initialized by the app
8
+ config.DEBUG_MODE && console.log('Firebase Analytics is ready to use');
9
+ } catch (error) {
10
+ console.error('Error initializing Firebase:', error);
11
+ }
12
+ }
13
+
14
+ async getAppInstanceId() {
15
+ try {
16
+ const appInstanceId = await analytics().getAppInstanceId();
17
+ config.DEBUG_MODE && console.log('Firebase App Instance ID:', appInstanceId);
18
+ return appInstanceId;
19
+ } catch (error) {
20
+ console.error('Error getting Firebase App Instance ID:', error);
21
+ return null;
22
+ }
23
+ }
24
+
25
+ async logEvent(eventName, params = {}) {
26
+ try {
27
+ await analytics().logEvent(eventName, params);
28
+ config.DEBUG_MODE && console.log('Firebase event logged:', eventName, params);
29
+ } catch (error) {
30
+ console.error('Error logging Firebase event:', error);
31
+ }
32
+ }
33
+
34
+ async setUserId(userId) {
35
+ try {
36
+ await analytics().setUserId(userId);
37
+ config.DEBUG_MODE && console.log('Firebase user ID set:', userId);
38
+ } catch (error) {
39
+ console.error('Error setting Firebase user ID:', error);
40
+ }
41
+ }
42
+
43
+ async setUserProperty(name, value) {
44
+ try {
45
+ await analytics().setUserProperty(name, value);
46
+ config.DEBUG_MODE && console.log('Firebase user property set:', name, value);
47
+ } catch (error) {
48
+ console.error('Error setting Firebase user property:', error);
49
+ }
50
+ }
51
+ }
52
+
53
+ export default new Firebase();
@@ -12,4 +12,5 @@ export { default as Voice } from './Voice';
12
12
  export { default as Adapty } from './Adapty';
13
13
  export { default as HomeActions } from './QuickActions';
14
14
  export { default as Facebook } from './Facebook';
15
+ export { default as Firebase } from './Firebase';
15
16
  export { default as Legal } from './Legal';
package/types/index.d.ts CHANGED
@@ -35,6 +35,7 @@ declare module 'apps-sdk' {
35
35
  isDevUser: boolean;
36
36
  forcedUpdate: boolean;
37
37
  init(): Promise<void>;
38
+ setDebugMode(debugMode: boolean): void;
38
39
  setConfigEndpoint(endpoint: string): void;
39
40
  initSession(): Promise<void>;
40
41
  storeSessionStructure(): Promise<void>;
@@ -259,6 +260,7 @@ declare module 'apps-sdk' {
259
260
  updateAdjustAttributionData(attribution: any): Promise<void>;
260
261
  setAdjustIntegrationIdentifier(adjustIntegrationIdentifier: string): Promise<void>;
261
262
  setMixpanelIntegrationIdentifier(mixpanelIntegrationIdentifier: string): Promise<void>;
263
+ setFirebaseIntegrationIdentifier(firebaseIntegrationIdentifier: string): Promise<void>;
262
264
  closePaywall(): Promise<void>;
263
265
  getOnboardingForPlacement(placementID: string, lang: string): Promise<any>;
264
266
  createOnboardingView(onboarding: any): Promise<any>;
@@ -295,6 +297,14 @@ declare module 'apps-sdk' {
295
297
  getLegalText(web_id: string, type: 'tc' | 'contact' | 'privacy_policy' | 'refund_policy' | 'faqs', lang: string): Promise<any>;
296
298
  }
297
299
 
300
+ export class Firebase {
301
+ initialize(): Promise<void>;
302
+ getAppInstanceId(): Promise<string | null>;
303
+ logEvent(eventName: string, params?: object): Promise<void>;
304
+ setUserId(userId: string): Promise<void>;
305
+ setUserProperty(name: string, value: string): Promise<void>;
306
+ }
307
+
298
308
  export class AppsSDK {
299
309
  initializePushNotifications(): Promise<string>;
300
310
  }
@@ -318,6 +328,7 @@ declare module 'apps-sdk' {
318
328
  adapty : Adapty;
319
329
  homeActions : HomeActions;
320
330
  facebook : Facebook;
331
+ firebase : Firebase;
321
332
  legal : Legal;
322
333
  }
323
334