tapjoy-react-native-sdk 14.4.0 → 14.5.0

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.
@@ -8,7 +8,7 @@ buildscript {
8
8
  }
9
9
 
10
10
  dependencies {
11
- classpath "com.android.tools.build:gradle:8.1.2"
11
+ classpath "com.android.tools.build:gradle:8.11.1"
12
12
  // noinspection DifferentKotlinGradleVersion
13
13
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
14
  classpath "com.facebook.react:react-native-gradle-plugin"
@@ -79,9 +79,9 @@ dependencies {
79
79
  // For < 0.71, this will be from the local maven repo
80
80
  // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
81
81
  //noinspection GradleDynamicVersion
82
- implementation 'com.facebook.react:react-native:0.74.1'
82
+ implementation 'com.facebook.react:react-native:0.81.0'
83
83
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
84
- implementation 'com.tapjoy:tapjoy-android-sdk:14.4.0'
84
+ implementation 'com.tapjoy:tapjoy-android-sdk:14.5.0'
85
85
  implementation "com.google.android.gms:play-services-ads-identifier:18.0.1"
86
86
  }
87
87
 
@@ -1,6 +1,6 @@
1
- TapjoyReactNativeSdk_kotlinVersion=1.9.24
1
+ TapjoyReactNativeSdk_kotlinVersion=2.1.20
2
2
  TapjoyReactNativeSdk_minSdkVersion=21
3
- TapjoyReactNativeSdk_targetSdkVersion=34
4
- TapjoyReactNativeSdk_compileSdkVersion=34
3
+ TapjoyReactNativeSdk_targetSdkVersion=36
4
+ TapjoyReactNativeSdk_compileSdkVersion=36
5
5
  TapjoyReactNativeSdk_ndkversion=25.1.8937393
6
6
  android.useAndroidX=true
@@ -79,8 +79,8 @@ class TJOfferwallDiscoverNativeView : TJOfferwallDiscoverView, TJOfferwallDiscov
79
79
  }
80
80
  }
81
81
 
82
- class OfferwallDiscoverEvent(surfaceId: Int, viewId: Int, private val eventName: String, private val data: WritableMap) : Event<OfferwallDiscoverEvent>(surfaceId, viewId) {
83
- override fun getEventName() = eventName
82
+ class OfferwallDiscoverEvent(surfaceId: Int, viewId: Int, private val name: String, private val data: WritableMap) : Event<OfferwallDiscoverEvent>(surfaceId, viewId) {
83
+ override fun getEventName() = name
84
84
 
85
85
  // All events for a given view can be coalesced.
86
86
  override fun getCoalescingKey(): Short = 0
@@ -73,7 +73,7 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
73
73
  fun connect(sdkKey: String, connectFlags: ReadableMap, promise: Promise) {
74
74
  TapjoyPluginAPI.setPlugin("ReactNative");
75
75
 
76
- Tapjoy.connect(this.currentActivity?.applicationContext, sdkKey, connectFlags.toHashtable(), object : TJConnectListener() {
76
+ Tapjoy.connect(this.getCurrentActivity()?.applicationContext, sdkKey, connectFlags.toHashtable(), object : TJConnectListener() {
77
77
  override fun onConnectSuccess() {
78
78
  promise.resolve(true)
79
79
  }
@@ -403,14 +403,6 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
403
403
  placements.remove(placement.name)
404
404
  }
405
405
 
406
- override fun onPurchaseRequest(placement: TJPlacement, actionRequest: TJActionRequest, name: String) {
407
-
408
- }
409
-
410
- override fun onRewardRequest(placement: TJPlacement, actionRequest: TJActionRequest, currencyName: String, value: Int) {
411
-
412
- }
413
-
414
406
  override fun onClick(placement: TJPlacement) {
415
407
 
416
408
  }
@@ -685,12 +677,12 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
685
677
 
686
678
  @ReactMethod
687
679
  fun optOutAdvertisingID(optOut: Boolean) {
688
- Tapjoy.optOutAdvertisingID(this.currentActivity?.applicationContext, optOut)
680
+ Tapjoy.optOutAdvertisingID(this.getCurrentActivity()?.applicationContext, optOut)
689
681
  }
690
682
 
691
683
  @ReactMethod
692
684
  fun getOptOutAdvertisingID(promise: Promise) {
693
- val optOutStatus = Tapjoy.getOptOutAdvertisingID(this.currentActivity?.applicationContext)
685
+ val optOutStatus = Tapjoy.getOptOutAdvertisingID(this.getCurrentActivity()?.applicationContext)
694
686
  if (optOutStatus != null) {
695
687
  promise.resolve(optOutStatus)
696
688
  } else {
@@ -703,8 +695,21 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
703
695
  val iterator = this.keySetIterator()
704
696
  while (iterator.hasNextKey()) {
705
697
  val key = iterator.nextKey()
706
- val value = this.getString(key)
707
- hashtable[key] = value?: continue
698
+ when (this.getType(key)) {
699
+ ReadableType.String -> {
700
+ this.getString(key)?.let { hashtable[key] = it }
701
+ }
702
+ ReadableType.Number -> {
703
+ val numberValue = this.getDouble(key)
704
+ val asInt = numberValue.toInt()
705
+ hashtable[key] = if (numberValue == asInt.toDouble()) asInt else numberValue
706
+ }
707
+ ReadableType.Boolean -> {
708
+ hashtable[key] = this.getBoolean(key)
709
+ }
710
+ ReadableType.Null, ReadableType.Map, ReadableType.Array -> {
711
+ }
712
+ }
708
713
  }
709
714
  return hashtable
710
715
  }
@@ -117,6 +117,6 @@ dependencies {
117
117
  }
118
118
 
119
119
  implementation 'com.google.android.gms:play-services-appset:16.0.2'
120
- implementation 'com.tapjoy:tapjoy-android-sdk:14.4.0'
120
+ implementation 'com.tapjoy:tapjoy-android-sdk:14.5.0'
121
121
 
122
122
  }
@@ -4,13 +4,11 @@ import android.app.Application
4
4
  import com.facebook.react.PackageList
5
5
  import com.facebook.react.ReactApplication
6
6
  import com.facebook.react.ReactHost
7
+ import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
7
8
  import com.facebook.react.ReactNativeHost
8
9
  import com.facebook.react.ReactPackage
9
- import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10
10
  import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11
11
  import com.facebook.react.defaults.DefaultReactNativeHost
12
- import com.facebook.react.soloader.OpenSourceMergedSoMapping
13
- import com.facebook.soloader.SoLoader
14
12
 
15
13
  class MainApplication : Application(), ReactApplication {
16
14
 
@@ -35,10 +33,6 @@ class MainApplication : Application(), ReactApplication {
35
33
 
36
34
  override fun onCreate() {
37
35
  super.onCreate()
38
- SoLoader.init(this, OpenSourceMergedSoMapping)
39
- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40
- // If you opted-in for the New Architecture, we load the native entry point for this app.
41
- load()
42
- }
36
+ loadReactNative(this)
43
37
  }
44
38
  }
@@ -1,11 +1,11 @@
1
1
  buildscript {
2
2
  ext {
3
- buildToolsVersion = "35.0.0"
3
+ buildToolsVersion = "36.0.0"
4
4
  minSdkVersion = 24
5
- compileSdkVersion = 35
6
- targetSdkVersion = 35
5
+ compileSdkVersion = 36
6
+ targetSdkVersion = 36
7
7
  ndkVersion = "27.1.12297006"
8
- kotlinVersion = "2.0.21"
8
+ kotlinVersion = "2.1.20"
9
9
  }
10
10
  repositories {
11
11
  google()
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
4
4
  networkTimeout=10000
5
5
  validateDistributionUrl=true
6
6
  zipStoreBase=GRADLE_USER_HOME
@@ -37,3 +37,8 @@ newArchEnabled=true
37
37
  # Use this property to enable or disable the Hermes JS engine.
38
38
  # If set to false, you will be using JSC instead.
39
39
  hermesEnabled=true
40
+
41
+ # Use this property to enable edge-to-edge display support.
42
+ # This allows your app to draw behind system bars for an immersive UI.
43
+ # Note: Only works with ReactActivity and should not be used with custom Activity.
44
+ edgeToEdgeEnabled=false
@@ -39,7 +39,7 @@
39
39
  <string>LaunchScreen</string>
40
40
  <key>UIRequiredDeviceCapabilities</key>
41
41
  <array>
42
- <string>armv64</string>
42
+ <string>arm64</string>
43
43
  </array>
44
44
  <key>UISupportedInterfaceOrientations</key>
45
45
  <array>
@@ -15,21 +15,10 @@
15
15
  B58E4E7E8EDB14A1C5F1CBAA /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = EDEB0408D1807C711EE2B6BB /* PrivacyInfo.xcprivacy */; };
16
16
  /* End PBXBuildFile section */
17
17
 
18
- /* Begin PBXContainerItemProxy section */
19
- 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
20
- isa = PBXContainerItemProxy;
21
- containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
22
- proxyType = 1;
23
- remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
24
- remoteInfo = TapjoyReactNativeSdkExample;
25
- };
26
- /* End PBXContainerItemProxy section */
27
-
28
18
  /* Begin PBXFileReference section */
29
19
  00E356EE1AD99517003FC87E /* TapjoyReactNativeSdkExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TapjoyReactNativeSdkExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
30
20
  13B07F961A680F5B00A75B9A /* TapjoyReactNativeSdkExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TapjoyReactNativeSdkExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
31
21
  13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = TapjoyReactNativeSdkExample/Images.xcassets; sourceTree = "<group>"; };
32
- 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = TapjoyReactNativeSdkExample/Info.plist; sourceTree = "<group>"; };
33
22
  19F6CBCC0A4E27FBF8BF4A61 /* libPods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
34
23
  3B4392A12AC88292D35C810B /* Pods-TapjoyReactNativeSdkExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TapjoyReactNativeSdkExample.debug.xcconfig"; path = "Target Support Files/Pods-TapjoyReactNativeSdkExample/Pods-TapjoyReactNativeSdkExample.debug.xcconfig"; sourceTree = "<group>"; };
35
24
  5709B34CF0A7D63546082F79 /* Pods-TapjoyReactNativeSdkExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TapjoyReactNativeSdkExample.release.xcconfig"; path = "Target Support Files/Pods-TapjoyReactNativeSdkExample/Pods-TapjoyReactNativeSdkExample.release.xcconfig"; sourceTree = "<group>"; };
@@ -62,27 +51,11 @@
62
51
  /* End PBXFrameworksBuildPhase section */
63
52
 
64
53
  /* Begin PBXGroup section */
65
- 00E356EF1AD99517003FC87E /* TapjoyReactNativeSdkExampleTests */ = {
66
- isa = PBXGroup;
67
- children = (
68
- 00E356F01AD99517003FC87E /* Supporting Files */,
69
- );
70
- path = TapjoyReactNativeSdkExampleTests;
71
- sourceTree = "<group>";
72
- };
73
- 00E356F01AD99517003FC87E /* Supporting Files */ = {
74
- isa = PBXGroup;
75
- children = (
76
- );
77
- name = "Supporting Files";
78
- sourceTree = "<group>";
79
- };
80
54
  13B07FAE1A68108700A75B9A /* TapjoyReactNativeSdkExample */ = {
81
55
  isa = PBXGroup;
82
56
  children = (
83
57
  5BA1D0092DD34B1600CF7906 /* AppDelegate.swift */,
84
58
  13B07FB51A68108700A75B9A /* Images.xcassets */,
85
- 13B07FB61A68108700A75B9A /* Info.plist */,
86
59
  81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
87
60
  EDEB0408D1807C711EE2B6BB /* PrivacyInfo.xcprivacy */,
88
61
  );
@@ -111,7 +84,6 @@
111
84
  children = (
112
85
  13B07FAE1A68108700A75B9A /* TapjoyReactNativeSdkExample */,
113
86
  832341AE1AAA6A7D00B99B32 /* Libraries */,
114
- 00E356EF1AD99517003FC87E /* TapjoyReactNativeSdkExampleTests */,
115
87
  83CBBA001A601CBA00E9B192 /* Products */,
116
88
  2D16E6871FA4F8E400B85C8A /* Frameworks */,
117
89
  BBD78D7AC51CEA395F1C20DB /* Pods */,
@@ -151,14 +123,12 @@
151
123
  A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */,
152
124
  00E356EA1AD99517003FC87E /* Sources */,
153
125
  00E356EB1AD99517003FC87E /* Frameworks */,
154
- 00E356EC1AD99517003FC87E /* Resources */,
155
126
  C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */,
156
127
  F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */,
157
128
  );
158
129
  buildRules = (
159
130
  );
160
131
  dependencies = (
161
- 00E356F51AD99517003FC87E /* PBXTargetDependency */,
162
132
  );
163
133
  name = TapjoyReactNativeSdkExampleTests;
164
134
  productName = TapjoyReactNativeSdkExampleTests;
@@ -224,13 +194,6 @@
224
194
  /* End PBXProject section */
225
195
 
226
196
  /* Begin PBXResourcesBuildPhase section */
227
- 00E356EC1AD99517003FC87E /* Resources */ = {
228
- isa = PBXResourcesBuildPhase;
229
- buildActionMask = 2147483647;
230
- files = (
231
- );
232
- runOnlyForDeploymentPostprocessing = 0;
233
- };
234
197
  13B07F8E1A680F5B00A75B9A /* Resources */ = {
235
198
  isa = PBXResourcesBuildPhase;
236
199
  buildActionMask = 2147483647;
@@ -411,14 +374,6 @@
411
374
  };
412
375
  /* End PBXSourcesBuildPhase section */
413
376
 
414
- /* Begin PBXTargetDependency section */
415
- 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
416
- isa = PBXTargetDependency;
417
- target = 13B07F861A680F5B00A75B9A /* TapjoyReactNativeSdkExample */;
418
- targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
419
- };
420
- /* End PBXTargetDependency section */
421
-
422
377
  /* Begin XCBuildConfiguration section */
423
378
  00E356F61AD99517003FC87E /* Debug */ = {
424
379
  isa = XCBuildConfiguration;
@@ -1,14 +1,10 @@
1
1
  const path = require('path');
2
2
  const escape = require('escape-string-regexp');
3
- const exclusionList = require('metro-config/src/defaults/exclusionList');
4
3
  const pak = require('../package.json');
5
4
  const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
6
5
 
7
6
  const root = path.resolve(__dirname, '..');
8
-
9
- const modules = Object.keys({
10
- ...pak.peerDependencies,
11
- });
7
+ const modules = Object.keys(pak.peerDependencies);
12
8
 
13
9
  /**
14
10
  * Metro configuration
@@ -17,20 +13,18 @@ const modules = Object.keys({
17
13
  * @type {import('@react-native/metro-config').MetroConfig}
18
14
  */
19
15
 
20
- module.exports = mergeConfig(getDefaultConfig(__dirname), {
16
+ const defaultConfig = getDefaultConfig(__dirname);
17
+
18
+ const blockList = modules.map(
19
+ (m) => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
20
+ );
21
+
22
+ module.exports = mergeConfig(defaultConfig, {
21
23
  projectRoot: __dirname,
22
24
  watchFolders: [root],
23
25
 
24
- // We need to make sure that only one version is loaded for peerDependencies
25
- // So we block them at the root, and alias them to the versions in example's node_modules
26
26
  resolver: {
27
- blacklistRE: exclusionList(
28
- modules.map(
29
- (m) =>
30
- new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
31
- )
32
- ),
33
-
27
+ blockList: blockList,
34
28
  extraNodeModules: modules.reduce((acc, name) => {
35
29
  acc[name] = path.join(__dirname, 'node_modules', name);
36
30
  return acc;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "TapjoyReactNativeSdkExample",
3
- "version": "14.4.0",
3
+ "version": "14.5.0",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "android": "react-native run-android",
@@ -12,30 +12,31 @@
12
12
  "tapjoy-react-native-sdk": "file:../",
13
13
  "@react-native-async-storage/async-storage": "^2.1.2",
14
14
  "@react-native-masked-view/masked-view": "^0.3.2",
15
- "@react-native-picker/picker": "^2.11.0",
15
+ "@react-native-picker/picker": "^2.11.1",
16
16
  "@react-navigation/bottom-tabs": "^7.3.13",
17
17
  "@react-navigation/native": "^7.1.9",
18
+ "@react-native/new-app-screen": "0.81.0",
18
19
  "dayjs": "^1.11.13",
19
- "react": "19.0.0",
20
- "react-native": "0.79.2",
21
- "react-native-gesture-handler": "^2.20.0",
20
+ "react": "19.1.0",
21
+ "react-native": "0.81.0",
22
+ "react-native-gesture-handler": "^2.28.0",
22
23
  "react-native-picker-select": "^9.3.1",
23
- "react-native-reanimated": "^3.15.3",
24
- "react-native-safe-area-context": "^5.4.0",
25
- "react-native-screens": "^4.10.0",
26
- "react-native-toast-message": "^2.2.1",
24
+ "react-native-reanimated": "^3.19.1",
25
+ "react-native-safe-area-context": "^5.6.1",
26
+ "react-native-screens": "^4.15.2",
27
+ "react-native-toast-message": "^2.3.3",
27
28
  "react-native-tracking-transparency": "^0.1.2"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@babel/core": "^7.25.2",
31
32
  "@babel/preset-env": "^7.25.4",
32
33
  "@babel/runtime": "^7.25.6",
33
- "@react-native-community/cli": "18.0.0",
34
- "@react-native-community/cli-platform-android": "18.0.0",
35
- "@react-native-community/cli-platform-ios": "18.0.0",
36
- "@react-native/babel-preset": "0.79.2",
37
- "@react-native/metro-config": "^0.76.6",
38
- "@react-native/typescript-config": "0.79.2"
34
+ "@react-native-community/cli": "20.0.0",
35
+ "@react-native-community/cli-platform-android": "20.0.0",
36
+ "@react-native-community/cli-platform-ios": "20.0.0",
37
+ "@react-native/babel-preset": "0.81.0",
38
+ "@react-native/metro-config": "0.81.0",
39
+ "@react-native/typescript-config": "0.81.0"
39
40
  },
40
41
  "engines": {
41
42
  "node": ">=18"
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import { useState } from 'react';
2
2
  import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
3
3
  import { NavigationContainer } from '@react-navigation/native';
4
4
  import { Dimensions } from 'react-native';
@@ -20,7 +20,6 @@ export default function App() {
20
20
  <ConnectContext.Provider value={{ isSdkConnected, setIsSdkConnected }}>
21
21
  <Tab.Navigator
22
22
  screenOptions={{
23
- scrollEnabled: true,
24
23
  tabBarLabelPosition: 'beside-icon',
25
24
  tabBarLabelStyle: styles.tabBarLabelStyle,
26
25
  tabBarIconStyle: styles.tabBarIconStyle,
@@ -1,12 +1,15 @@
1
1
  import React, { useState, useEffect, useContext } from 'react';
2
2
  import {
3
3
  View,
4
- SafeAreaView,
5
4
  TextInput,
6
5
  Platform,
7
6
  Text,
8
7
  ScrollView,
9
8
  } from 'react-native';
9
+ import {
10
+ SafeAreaProvider,
11
+ useSafeAreaInsets,
12
+ } from 'react-native-safe-area-context';
10
13
  import AsyncStorage from '@react-native-async-storage/async-storage';
11
14
  import {
12
15
  getTrackingStatus,
@@ -73,17 +76,17 @@ const MainScreen: React.FC = () => {
73
76
  }
74
77
 
75
78
  await Tapjoy.connect(sdkKey, flags, (event: TapjoyEvent) => {
76
- setStatusLabelText(`Tapjoy SDK connected with Warning: ErrorCode: ${event.code} ${event.message} `);
77
- },
79
+ setStatusLabelText(`Tapjoy SDK connected with Warning: ErrorCode: ${event.code} ${event.message} `);
80
+ },
78
81
  );
79
82
  setIsConnecting(false);
80
83
  setSelectedLoggingLevel(await Tapjoy.getLoggingLevel());
81
84
  Tapjoy.setCustomParameter("my_parameter");
82
85
  setStatusLabelText(
83
86
  'Tapjoy SDK Connected' +
84
- (Object.keys(flags).length > 0
85
- ? `\nFlags: ${JSON.stringify(flags)}`
86
- : '')
87
+ (Object.keys(flags).length > 0
88
+ ? `\nFlags: ${JSON.stringify(flags)}`
89
+ : '')
87
90
  );
88
91
  setIsSdkConnected(true);
89
92
  } catch (error: any) {
@@ -107,9 +110,9 @@ const MainScreen: React.FC = () => {
107
110
  let result = await Tapjoy.getCurrencyBalance();
108
111
  setStatusLabelText(
109
112
  'getCurrencyBalance returned ' +
110
- result.currencyName +
111
- ': ' +
112
- result.amount
113
+ result.currencyName +
114
+ ': ' +
115
+ result.amount
113
116
  );
114
117
  } catch (error: any) {
115
118
  setStatusLabelText(error.toString());
@@ -154,69 +157,81 @@ const MainScreen: React.FC = () => {
154
157
  }
155
158
  };
156
159
 
160
+ const safeAreaInsets = useSafeAreaInsets();
161
+
157
162
  return (
158
- <View style={styles.mainContainer}>
159
- <ScrollView>
160
- <SafeAreaView style={styles.container}>
161
- <View style={styles.lineGap}>
162
- <Text style={styles.statusText}>{statusLabelText}</Text>
163
- </View>
164
- <View style={styles.inputContainer}>
165
- <TextInput
166
- style={styles.textInput}
167
- value={sdkKey}
168
- onChangeText={setSdkKey}
169
- placeholder="Enter SDK Key"
170
- />
171
- <Button
172
- title="Connect"
173
- style={[styles.zeroFlex, styles.leftSpacing]}
174
- onPress={handleConnect}
175
- disabled={isConnecting || Tapjoy.isConnected()}
176
- />
177
- </View>
178
- <View style={styles.currencyOuterContainer}>
179
- <Text style={styles.labelText}>{'Managed Currency:'}</Text>
163
+ <SafeAreaProvider>
164
+ <View style={[
165
+ styles.mainContainer,
166
+ {
167
+ paddingTop: safeAreaInsets.top,
168
+ paddingBottom: safeAreaInsets.bottom,
169
+ paddingLeft: safeAreaInsets.left,
170
+ paddingRight: safeAreaInsets.right,
171
+ },
172
+ ]}>
173
+ <ScrollView>
174
+ <View style={styles.container}>
175
+ <View style={styles.lineGap}>
176
+ <Text style={styles.statusText}>{statusLabelText}</Text>
177
+ </View>
180
178
  <View style={styles.inputContainer}>
181
- <Text style={styles.userPropertiesLabel}>Amount:</Text>
182
179
  <TextInput
183
180
  style={styles.textInput}
184
- keyboardType='numeric'
185
- value={curerncySpendAwardAmount}
186
- onChangeText={handleAmountChange}
187
- placeholder="Managed Currency value"
188
- />
189
- </View>
190
- <View style={styles.currencyInnerContainer}>
191
- <Button
192
- style={styles.buttonGap}
193
- title="Get"
194
- onPress={getCurrencyBalance}
181
+ value={sdkKey}
182
+ onChangeText={setSdkKey}
183
+ placeholder="Enter SDK Key"
195
184
  />
196
185
  <Button
197
- style={styles.buttonGap}
198
- title="Spend"
199
- onPress={spendCurrency}
186
+ title="Connect"
187
+ style={[styles.zeroFlex, styles.leftSpacing]}
188
+ onPress={handleConnect}
189
+ disabled={isConnecting || Tapjoy.isConnected()}
200
190
  />
201
- <Button title="Award" onPress={awardCurrency} />
202
191
  </View>
203
- <View style={styles.selectionContainer}>
204
- <View style={styles.horizontalContainer}>
205
- <Text style={styles.userPropertiesLabel}>Logging Level:</Text>
206
- <SelectionMenu
207
- data={loggingLevelData}
208
- onSelectItem={handleLoggingLevelChange}
209
- initialSelectedItem={loggingLevelData[selectedLoggingLevel]}
192
+ <View style={styles.currencyOuterContainer}>
193
+ <Text style={styles.labelText}>{'Managed Currency:'}</Text>
194
+ <View style={styles.inputContainer}>
195
+ <Text style={styles.userPropertiesLabel}>Amount:</Text>
196
+ <TextInput
197
+ style={styles.textInput}
198
+ keyboardType='numeric'
199
+ value={curerncySpendAwardAmount}
200
+ onChangeText={handleAmountChange}
201
+ placeholder="Managed Currency value"
210
202
  />
211
203
  </View>
204
+ <View style={styles.currencyInnerContainer}>
205
+ <Button
206
+ style={styles.buttonGap}
207
+ title="Get"
208
+ onPress={getCurrencyBalance}
209
+ />
210
+ <Button
211
+ style={styles.buttonGap}
212
+ title="Spend"
213
+ onPress={spendCurrency}
214
+ />
215
+ <Button title="Award" onPress={awardCurrency} />
216
+ </View>
217
+ <View style={styles.selectionContainer}>
218
+ <View style={styles.horizontalContainer}>
219
+ <Text style={styles.userPropertiesLabel}>Logging Level:</Text>
220
+ <SelectionMenu
221
+ data={loggingLevelData}
222
+ onSelectItem={handleLoggingLevelChange}
223
+ initialSelectedItem={loggingLevelData[selectedLoggingLevel]}
224
+ />
225
+ </View>
226
+ </View>
212
227
  </View>
213
228
  </View>
214
- </SafeAreaView>
215
- </ScrollView>
216
- <Text style={styles.versionText}>
217
- Version: {TJVersion.getPluginVersion()}
218
- </Text>
219
- </View>
229
+ </ScrollView>
230
+ <Text style={styles.versionText}>
231
+ Version: {TJVersion.getPluginVersion()}
232
+ </Text>
233
+ </View>
234
+ </SafeAreaProvider>
220
235
  );
221
236
  };
222
237