tapjoy-react-native-sdk 14.3.0 → 14.4.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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/tapjoyreactnativesdk/TapjoyReactNativeSdkModule.kt +39 -0
- package/example/Gemfile +9 -1
- package/example/android/app/build.gradle +3 -3
- package/example/android/build.gradle +3 -3
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradlew +2 -3
- package/example/babel.config.js +0 -9
- package/example/ios/AppDelegate.swift +55 -0
- package/example/ios/Podfile +0 -1
- package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.pbxproj +5 -17
- package/example/metro.config.js +1 -1
- package/example/package.json +15 -15
- package/example/src/MainScreen.tsx +39 -5
- package/ios/TapjoyReactNativeSdk.m +4 -1
- package/ios/TapjoyReactNativeSdk.swift +14 -6
- package/lib/commonjs/TJLoggingLevel.js +8 -0
- package/lib/commonjs/TJVersion.js +1 -1
- package/lib/commonjs/Tapjoy.js +41 -1
- package/lib/commonjs/TapjoyEvent.js +1 -1
- package/lib/commonjs/index.js +2 -1
- package/lib/typescript/TJLoggingLevel.d.ts +7 -0
- package/lib/typescript/Tapjoy.d.ts +31 -0
- package/lib/typescript/TapjoyEvent.d.ts +1 -1
- package/lib/typescript/index.d.ts +4 -1
- package/package.json +4 -4
- package/src/TJLoggingLevel.ts +8 -0
- package/src/TJStatus.ts +1 -1
- package/src/TJVersion.ts +1 -1
- package/src/Tapjoy.ts +46 -3
- package/src/TapjoyEvent.ts +2 -2
- package/src/index.ts +4 -0
- package/tapjoy-react-native-sdk.podspec +1 -1
- package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.h +0 -6
- package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.mm +0 -31
- package/example/ios/TapjoyReactNativeSdkExample/main.m +0 -10
- package/example/ios/TapjoyReactNativeSdkExampleTests/Info.plist +0 -24
- package/example/ios/TapjoyReactNativeSdkExampleTests/TapjoyReactNativeSdkExampleTests.m +0 -66
- package/example/package-lock.json +0 -8605
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import TJSegment from './TJSegment';
|
|
2
|
+
import TJLoggingLevel from './TJLoggingLevel';
|
|
3
|
+
import { TapjoyEvent } from './TapjoyEvent';
|
|
2
4
|
declare class Tapjoy {
|
|
3
5
|
/**
|
|
4
6
|
* Connects to the Tapjoy Server.
|
|
@@ -49,6 +51,23 @@ declare class Tapjoy {
|
|
|
49
51
|
*/
|
|
50
52
|
static trackPurchase(currencyCode: string, price: number): void;
|
|
51
53
|
/**
|
|
54
|
+
* Sets the logging level for Tapjoy.
|
|
55
|
+
*
|
|
56
|
+
* @param loggingLevel
|
|
57
|
+
* the logging level to set
|
|
58
|
+
* @see TJLoggingLevel
|
|
59
|
+
*/
|
|
60
|
+
static setLoggingLevel(loggingLevel: TJLoggingLevel): void;
|
|
61
|
+
/**
|
|
62
|
+
* Gets the current logging level for Tapjoy.
|
|
63
|
+
*
|
|
64
|
+
* @return the current logging level
|
|
65
|
+
* @see TJLoggingLevel
|
|
66
|
+
*/
|
|
67
|
+
static getLoggingLevel(): Promise<any>;
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated Deprecated in 14.4.0 in favor of setLoggingLevel
|
|
70
|
+
*
|
|
52
71
|
* Enables or disables Tapjoy logging
|
|
53
72
|
*
|
|
54
73
|
* @param enable
|
|
@@ -144,5 +163,17 @@ declare class Tapjoy {
|
|
|
144
163
|
* the tag to be removed
|
|
145
164
|
*/
|
|
146
165
|
static removeUserTag(tag: string): void;
|
|
166
|
+
/**
|
|
167
|
+
* Assign a custom parameter associated with any following placement requests that contains an ad type. We will return this value on the currency callback.
|
|
168
|
+
* Only applicable for publishers who manage their own currency servers. This value does NOT get unset with each subsequent placement request.
|
|
169
|
+
* @param customParameter
|
|
170
|
+
* The custom parameter to assign to this device
|
|
171
|
+
*/
|
|
172
|
+
static setCustomParameter(customParameter: string): void;
|
|
173
|
+
/**
|
|
174
|
+
* Returns the currently set custom parameter.
|
|
175
|
+
* @return the value of the currently set custom parameter.
|
|
176
|
+
*/
|
|
177
|
+
static getCustomParameter(): Promise<any>;
|
|
147
178
|
}
|
|
148
179
|
export default Tapjoy;
|
|
@@ -5,6 +5,9 @@ import TJStatus from './TJStatus';
|
|
|
5
5
|
import TJSegment from './TJSegment';
|
|
6
6
|
import TJOfferwallDiscoverView from './TJOfferwallDiscoverView';
|
|
7
7
|
import TJPurchase from './TJPurchase';
|
|
8
|
+
import TJLoggingLevel from './TJLoggingLevel';
|
|
8
9
|
import Tapjoy from './Tapjoy';
|
|
9
|
-
|
|
10
|
+
import { TapjoyEvent } from './TapjoyEvent';
|
|
11
|
+
export { Tapjoy, TJPlacement, TJPrivacyPolicy, TJVersion, TJStatus, TJSegment, TJOfferwallDiscoverView, TJPurchase, TJLoggingLevel, };
|
|
12
|
+
export type { TapjoyEvent };
|
|
10
13
|
export default Tapjoy;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tapjoy-react-native-sdk",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.4.0",
|
|
4
4
|
"description": "ReactNative Plugin for Tapjoy SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@commitlint/config-conventional": "^19.5.0",
|
|
79
79
|
"@react-native-community/eslint-config": "^3.2.0",
|
|
80
|
-
"@react-native/metro-config": "^0.
|
|
80
|
+
"@react-native/metro-config": "^0.79.2",
|
|
81
81
|
"@types/jest": "^29.5.13",
|
|
82
82
|
"@types/react": "^18.3.10",
|
|
83
83
|
"commitlint": "^19.5.0",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"jest": "^29.7.0",
|
|
89
89
|
"pod-install": "^0.2.2",
|
|
90
90
|
"prettier": "^3.3.3",
|
|
91
|
-
"react": "^
|
|
92
|
-
"react-native": "0.
|
|
91
|
+
"react": "^19.0.0",
|
|
92
|
+
"react-native": "0.79.2",
|
|
93
93
|
"typedoc": "^0.26.7",
|
|
94
94
|
"typescript": "^5.6.2"
|
|
95
95
|
},
|
package/src/TJStatus.ts
CHANGED
package/src/TJVersion.ts
CHANGED
package/src/Tapjoy.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { NativeModules, Platform, NativeEventEmitter } from 'react-native';
|
|
2
2
|
import TJSegment from './TJSegment';
|
|
3
3
|
import TJConnect from './TJConnect';
|
|
4
|
+
import TJLoggingLevel from './TJLoggingLevel';
|
|
5
|
+
import { TapjoyEvent } from './TapjoyEvent';
|
|
4
6
|
|
|
5
7
|
const LINKING_ERROR =
|
|
6
8
|
`The package 'tapjoy-react-native-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
|
@@ -99,15 +101,38 @@ class Tapjoy {
|
|
|
99
101
|
TapjoyAPI.trackPurchase(currencyCode, price);
|
|
100
102
|
}
|
|
101
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Sets the logging level for Tapjoy.
|
|
106
|
+
*
|
|
107
|
+
* @param loggingLevel
|
|
108
|
+
* the logging level to set
|
|
109
|
+
* @see TJLoggingLevel
|
|
110
|
+
*/
|
|
111
|
+
public static setLoggingLevel(loggingLevel: TJLoggingLevel) {
|
|
112
|
+
TapjoyAPI.setLoggingLevel(loggingLevel);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Gets the current logging level for Tapjoy.
|
|
117
|
+
*
|
|
118
|
+
* @return the current logging level
|
|
119
|
+
* @see TJLoggingLevel
|
|
120
|
+
*/
|
|
121
|
+
public static async getLoggingLevel() {
|
|
122
|
+
return await TapjoyAPI.getLoggingLevel();
|
|
123
|
+
};
|
|
124
|
+
|
|
102
125
|
/**
|
|
126
|
+
* @deprecated Deprecated in 14.4.0 in favor of setLoggingLevel
|
|
127
|
+
*
|
|
103
128
|
* Enables or disables Tapjoy logging
|
|
104
|
-
*
|
|
129
|
+
*
|
|
105
130
|
* @param enable
|
|
106
131
|
* set to true if logging should be enabled, false to disable
|
|
107
132
|
* logging
|
|
108
133
|
*/
|
|
109
134
|
public static setDebugEnabled(enable: Boolean) {
|
|
110
|
-
TapjoyAPI.
|
|
135
|
+
TapjoyAPI.setLoggingLevel(enable ? TJLoggingLevel.Debug : TJLoggingLevel.Error);
|
|
111
136
|
};
|
|
112
137
|
|
|
113
138
|
/**
|
|
@@ -236,5 +261,23 @@ class Tapjoy {
|
|
|
236
261
|
public static removeUserTag(tag: string) {
|
|
237
262
|
TapjoyAPI.removeUserTag(tag);
|
|
238
263
|
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Assign a custom parameter associated with any following placement requests that contains an ad type. We will return this value on the currency callback.
|
|
267
|
+
* Only applicable for publishers who manage their own currency servers. This value does NOT get unset with each subsequent placement request.
|
|
268
|
+
* @param customParameter
|
|
269
|
+
* The custom parameter to assign to this device
|
|
270
|
+
*/
|
|
271
|
+
public static setCustomParameter(customParameter: string) {
|
|
272
|
+
TapjoyAPI.setCustomParameter(customParameter);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Returns the currently set custom parameter.
|
|
277
|
+
* @return the value of the currently set custom parameter.
|
|
278
|
+
*/
|
|
279
|
+
public static async getCustomParameter() {
|
|
280
|
+
return TapjoyAPI.getCustomParameter();
|
|
281
|
+
}
|
|
239
282
|
}
|
|
240
|
-
export default Tapjoy;
|
|
283
|
+
export default Tapjoy;
|
package/src/TapjoyEvent.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,7 +5,9 @@ import TJStatus from './TJStatus';
|
|
|
5
5
|
import TJSegment from './TJSegment';
|
|
6
6
|
import TJOfferwallDiscoverView from './TJOfferwallDiscoverView';
|
|
7
7
|
import TJPurchase from './TJPurchase';
|
|
8
|
+
import TJLoggingLevel from './TJLoggingLevel';
|
|
8
9
|
import Tapjoy from './Tapjoy';
|
|
10
|
+
import { TapjoyEvent } from './TapjoyEvent';
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
export {
|
|
@@ -17,5 +19,7 @@ export {
|
|
|
17
19
|
TJSegment,
|
|
18
20
|
TJOfferwallDiscoverView,
|
|
19
21
|
TJPurchase,
|
|
22
|
+
TJLoggingLevel,
|
|
20
23
|
};
|
|
24
|
+
export type { TapjoyEvent };
|
|
21
25
|
export default Tapjoy;
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "TapjoySDK", "14.
|
|
20
|
+
s.dependency "TapjoySDK", "14.4.0"
|
|
21
21
|
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
23
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#import "AppDelegate.h"
|
|
2
|
-
|
|
3
|
-
#import <React/RCTBundleURLProvider.h>
|
|
4
|
-
|
|
5
|
-
@implementation AppDelegate
|
|
6
|
-
|
|
7
|
-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
8
|
-
{
|
|
9
|
-
self.moduleName = @"TapjoyReactNativeSdkExample";
|
|
10
|
-
// You can add your custom initial props in the dictionary below.
|
|
11
|
-
// They will be passed down to the ViewController used by React Native.
|
|
12
|
-
self.initialProps = @{};
|
|
13
|
-
|
|
14
|
-
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
18
|
-
{
|
|
19
|
-
return [self bundleURL];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
- (NSURL *)bundleURL
|
|
23
|
-
{
|
|
24
|
-
#if DEBUG
|
|
25
|
-
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
26
|
-
#else
|
|
27
|
-
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
28
|
-
#endif
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>en</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>BNDL</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleSignature</key>
|
|
20
|
-
<string>????</string>
|
|
21
|
-
<key>CFBundleVersion</key>
|
|
22
|
-
<string>1</string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
#import <XCTest/XCTest.h>
|
|
3
|
-
|
|
4
|
-
#import <React/RCTLog.h>
|
|
5
|
-
#import <React/RCTRootView.h>
|
|
6
|
-
|
|
7
|
-
#define TIMEOUT_SECONDS 600
|
|
8
|
-
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
|
9
|
-
|
|
10
|
-
@interface TapjoyReactNativeSdkExampleTests : XCTestCase
|
|
11
|
-
|
|
12
|
-
@end
|
|
13
|
-
|
|
14
|
-
@implementation TapjoyReactNativeSdkExampleTests
|
|
15
|
-
|
|
16
|
-
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
|
|
17
|
-
{
|
|
18
|
-
if (test(view)) {
|
|
19
|
-
return YES;
|
|
20
|
-
}
|
|
21
|
-
for (UIView *subview in [view subviews]) {
|
|
22
|
-
if ([self findSubviewInView:subview matching:test]) {
|
|
23
|
-
return YES;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return NO;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
- (void)testRendersWelcomeScreen
|
|
30
|
-
{
|
|
31
|
-
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
|
32
|
-
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
33
|
-
BOOL foundElement = NO;
|
|
34
|
-
|
|
35
|
-
__block NSString *redboxError = nil;
|
|
36
|
-
#ifdef DEBUG
|
|
37
|
-
RCTSetLogFunction(
|
|
38
|
-
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
39
|
-
if (level >= RCTLogLevelError) {
|
|
40
|
-
redboxError = message;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
#endif
|
|
44
|
-
|
|
45
|
-
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
46
|
-
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
47
|
-
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
48
|
-
|
|
49
|
-
foundElement = [self findSubviewInView:vc.view
|
|
50
|
-
matching:^BOOL(UIView *view) {
|
|
51
|
-
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
52
|
-
return YES;
|
|
53
|
-
}
|
|
54
|
-
return NO;
|
|
55
|
-
}];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#ifdef DEBUG
|
|
59
|
-
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
60
|
-
#endif
|
|
61
|
-
|
|
62
|
-
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
63
|
-
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@end
|