@braze/react-native-sdk
Advanced tools
Comparing version 11.0.0 to 12.0.0
@@ -695,2 +695,17 @@ const NativeEventEmitter = require('react-native').NativeEventEmitter; | ||
test('it calls BrazeReactBridge.getFeatureFlagTimestampProperty', () => { | ||
Braze.getFeatureFlagTimestampProperty('id', 'key'); | ||
expect(NativeBrazeReactModule.getFeatureFlagTimestampProperty).toBeCalled(); | ||
}); | ||
test('it calls BrazeReactBridge.getFeatureFlagJSONProperty', () => { | ||
Braze.getFeatureFlagJSONProperty('id', 'key'); | ||
expect(NativeBrazeReactModule.getFeatureFlagJSONProperty).toBeCalled(); | ||
}); | ||
test('it calls BrazeReactBridge.getFeatureFlagImageProperty', () => { | ||
Braze.getFeatureFlagImageProperty('id', 'key'); | ||
expect(NativeBrazeReactModule.getFeatureFlagImageProperty).toBeCalled(); | ||
}); | ||
test('it calls BrazeReactBridge.updateTrackingPropertyAllowList', () => { | ||
@@ -697,0 +712,0 @@ const allowList = { |
@@ -93,2 +93,5 @@ jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter'); | ||
getFeatureFlagStringProperty: jest.fn(), | ||
getFeatureFlagTimestampProperty: jest.fn(), | ||
getFeatureFlagJSONProperty: jest.fn(), | ||
getFeatureFlagImageProperty: jest.fn(), | ||
setAdTrackingEnabled: jest.fn(), | ||
@@ -95,0 +98,0 @@ updateTrackingPropertyAllowList: jest.fn() |
{ | ||
"name": "@braze/react-native-sdk", | ||
"version": "11.0.0", | ||
"version": "12.0.0", | ||
"description": "Braze SDK for React Native.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
<p align="center"> | ||
<img width="480" src=".github/assets/logo-light.png#gh-light-mode-only" /> | ||
<img width="480" src=".github/assets/logo-dark.png#gh-dark-mode-only" /> | ||
<img width="480" alt="Braze Logo" src=".github/assets/logo-light.png#gh-light-mode-only" /> | ||
<img width="480" alt="Braze Logo" src=".github/assets/logo-dark.png#gh-dark-mode-only" /> | ||
</p> | ||
@@ -5,0 +5,0 @@ |
@@ -712,3 +712,2 @@ import { | ||
* Enables the Braze SDK after a previous call to disableSDK(). | ||
* On iOS, the SDK will be enabled only after a subsequent call to startWithApiKey(). | ||
*/ | ||
@@ -780,3 +779,2 @@ static enableSDK() { | ||
// Refresh Content Cards | ||
/** | ||
@@ -939,2 +937,26 @@ * Requests a refresh of the content cards from Braze's servers. | ||
/** | ||
* Returns the timestamp property for the given feature flag ID. | ||
* @returns {Promise<number|null>} | ||
*/ | ||
static getFeatureFlagTimestampProperty(id, key) { | ||
return this.bridge.getFeatureFlagTimestampProperty(id, key); | ||
} | ||
/** | ||
* Returns the JSON property for the given feature flag ID. | ||
* @returns {Promise<object|null>} | ||
*/ | ||
static getFeatureFlagJSONProperty(id, key) { | ||
return this.bridge.getFeatureFlagJSONProperty(id, key); | ||
} | ||
/** | ||
* Returns the image property for the given feature flag ID. | ||
* @returns {Promise<string|null>} | ||
*/ | ||
static getFeatureFlagImageProperty(id, key) { | ||
return this.bridge.getFeatureFlagImageProperty(id, key); | ||
} | ||
/** | ||
* This method informs Braze whether ad-tracking has been enabled for this device. Note that the SDK does not | ||
@@ -941,0 +963,0 @@ * automatically collect this data. |
@@ -708,3 +708,2 @@ // Definitions by: ahanriat <https://github.com/ahanriat> | ||
* Enables the Braze SDK after a previous call to disableSDK(). | ||
* On iOS, the SDK will be enabled only after a subsequent call to startWithApiKey(). | ||
*/ | ||
@@ -878,2 +877,35 @@ export function enableSDK(): void; | ||
/** | ||
* A Feature Flag timestamp property of type Number. | ||
*/ | ||
export interface FeatureFlagTimestampProperty { | ||
/** The type of Feature Flag property. */ | ||
type: "timestamp"; | ||
/** The value of the property. */ | ||
value: number; | ||
} | ||
/** | ||
* A Feature Flag JSON property of type Object. | ||
*/ | ||
export interface FeatureFlagJSONProperty { | ||
/** The type of Feature Flag property. */ | ||
type: "jsonobject"; | ||
/** The value of the property. */ | ||
value: object; | ||
} | ||
/** | ||
* A Feature Flag image property of type String. | ||
*/ | ||
export interface FeatureFlagImageProperty { | ||
/** The type of Feature Flag property. */ | ||
type: "image"; | ||
/** The value of the property. */ | ||
value: string; | ||
} | ||
/** | ||
* [Braze Feature Flags](https://www.braze.com/docs/developer_guide/platform_wide/feature_flags) | ||
@@ -886,3 +918,3 @@ */ | ||
/** Properties of this feature flag, listed as key-value pairs. */ | ||
properties: Partial<Record<string, FeatureFlagStringProperty | FeatureFlagNumberProperty | FeatureFlagBooleanProperty>>; | ||
properties: Partial<Record<string, FeatureFlagStringProperty | FeatureFlagNumberProperty | FeatureFlagBooleanProperty | FeatureFlagTimestampProperty | FeatureFlagJSONProperty | FeatureFlagImageProperty>>; | ||
@@ -945,2 +977,38 @@ /** The ID for this feature flag. */ | ||
/** | ||
* Get value of a feature flag timestamp property of type number. | ||
* | ||
* @param id - The ID of the feature flag. | ||
* @param key - The key of the property. | ||
* | ||
* @returns A promise containing the value of the property if the key is found and is of type number. | ||
* If the key is not found, if there is a type mismatch, or if there is no feature flag for that ID, | ||
* this method will return a null. | ||
*/ | ||
export function getFeatureFlagTimestampProperty(id: string, key: string): Promise<number | null>; | ||
/** | ||
* Get value of a feature flag JSON object property of type string. | ||
* | ||
* @param id - The ID of the feature flag. | ||
* @param key - The key of the property. | ||
* | ||
* @returns A promise containing the value of the property if the key is found and is of type number. | ||
* If the key is not found, if there is a type mismatch, or if there is no feature flag for that ID, | ||
* this method will return a null. | ||
*/ | ||
export function getFeatureFlagJSONProperty(id: string, key: string): Promise<string | null>; | ||
/** | ||
* Get value of a feature flag image property of type string. | ||
* | ||
* @param id - The ID of the feature flag. | ||
* @param key - The key of the property. | ||
* | ||
* @returns A promise containing the value of the property if the key is found and is of type number. | ||
* If the key is not found, if there is a type mismatch, or if there is no feature flag for that ID, | ||
* this method will return a null. | ||
*/ | ||
export function getFeatureFlagImageProperty(id: string, key: string): Promise<string | null>; | ||
/** | ||
* Requests a refresh of Feature Flags from the Braze server. | ||
@@ -1264,3 +1332,3 @@ */ | ||
export interface PushNotificationEvent { | ||
/* Notification payload type. Only `push_opened` events are supported on iOS. */ | ||
/* Notification payload type. */ | ||
payload_type: string; | ||
@@ -1267,0 +1335,0 @@ |
@@ -194,2 +194,5 @@ import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; | ||
getFeatureFlagNumberProperty(flagId: string, key: string): Promise<number | null>; | ||
getFeatureFlagTimestampProperty(flagId: string, key: string): Promise<number | null>; | ||
getFeatureFlagJSONProperty(flagId: string, key: string): Promise<Object | null>; | ||
getFeatureFlagImageProperty(flagId: string, key: string): Promise<string | null>; | ||
refreshFeatureFlags(): void; | ||
@@ -196,0 +199,0 @@ logFeatureFlagImpression(flagId: string): void; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
293776
3491