Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ internal fun ReadableMap.generalStyleSettingsFromMap(context: Context): GeneralS
font = getMap("font")?.bannerFontFromMap(context = context),
logo = getMap("logo")?.bannerLogoFromMap(context = context),
links = getString("links")?.legalLinksFromEnumString(),
disableSystemBackButton = getBooleanOrNull("disableSystemBackButton")
disableSystemBackButton = getBooleanOrNull("disableSystemBackButton"),
windowFullscreen = getBooleanOrNull("windowFullscreen")
Comment thread
asadraza-usercentrics marked this conversation as resolved.
Comment thread
asadraza-usercentrics marked this conversation as resolved.
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.usercentrics.reactnativesdk.sample

import android.os.Bundle
import androidx.core.view.WindowCompat
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultReactActivityDelegate
Expand All @@ -27,5 +28,6 @@ class MainActivity : ReactActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
}
}
11 changes: 11 additions & 0 deletions sample/src/screens/CustomizationExamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ export const customizationExampleTwo: BannerSettings = {
}


// MSDK-4636: exercises the windowFullscreen backward-compat workaround (Android only) —
// see https://usercentrics.atlassian.net/browse/MSDK-4636
export const windowFullscreenExample: BannerSettings = {
firstLayerStyleSettings: {
layout: UsercentricsLayout.full,
},
generalStyleSettings: {
windowFullscreen: true,
}
}

function createBannerLogo(): BannerLogo {
// Logo name is used for iOS and the Image.resolveAssetSource is used for Android.
const customLogo = new BannerLogo("logo.png", Image.resolveAssetSource(require('../../assets/images/logo.png')))
Expand Down
3 changes: 2 additions & 1 deletion sample/src/screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
UsercentricsConsentUserResponse,
UsercentricsServiceConsent,
} from '@usercentrics/react-native-sdk';
import { customizationExampleOne, customizationExampleTwo } from './CustomizationExamples';
import { customizationExampleOne, customizationExampleTwo, windowFullscreenExample } from './CustomizationExamples';

export const HomeScreen = ({ navigation }: { navigation: any }) => {
function applyConsent(_consents?: UsercentricsServiceConsent[] | null) {
Expand Down Expand Up @@ -94,6 +94,7 @@ export const HomeScreen = ({ navigation }: { navigation: any }) => {
<Button onPress={showSecondLayer} title="Show Second Layer" />
<Button onPress={() => showFirstLayer(customizationExampleOne)} title="Customization Example 1" />
<Button onPress={() => showFirstLayer(customizationExampleTwo)} title="Customization Example 2" />
<Button onPress={() => showFirstLayer(windowFullscreenExample)} title="Window Fullscreen (Android)" />
Comment thread
asadraza-usercentrics marked this conversation as resolved.
<Button onPress={async () => { await Usercentrics.status(); navigation.navigate('CustomUI'); }} title="Custom UI" />
<Button onPress={async () => { await Usercentrics.status(); navigation.navigate('WebviewIntegration'); }} title="Webview Integration" />
<Button onPress={() => navigation.navigate('GPPTesting')} title="GPP Testing" />
Expand Down
9 changes: 8 additions & 1 deletion src/models/BannerSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ export class GeneralStyleSettings {
bordersColorHex?: String;
toggleStyleSettings?: ToggleStyleSettings;
disableSystemBackButton?: Boolean;
/**
* Android-only. Backward-compat workaround for publishers who relied on the legacy
* fullscreen dialog behavior prior to the edge-to-edge fix. Has no effect on iOS.
*/
windowFullscreen?: Boolean;
Comment thread
asadraza-usercentrics marked this conversation as resolved.

constructor(font?: BannerFont,
logo?: BannerLogo,
Expand All @@ -85,7 +90,8 @@ export class GeneralStyleSettings {
tabColorHex?: String,
bordersColorHex?: String,
toggleStyleSettings?: ToggleStyleSettings,
disableSystemBackButton?: Boolean
disableSystemBackButton?: Boolean,
windowFullscreen?: Boolean
) {
this.font = font;
this.logo = logo;
Expand All @@ -98,6 +104,7 @@ export class GeneralStyleSettings {
this.bordersColorHex = bordersColorHex;
this.toggleStyleSettings = toggleStyleSettings;
this.disableSystemBackButton = disableSystemBackButton;
this.windowFullscreen = windowFullscreen;
Comment thread
asadraza-usercentrics marked this conversation as resolved.
}
}

Expand Down
Loading