com-tapp-so-sdk 0.1.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/ComTappSoSdk.podspec +50 -0
- package/LICENSE +20 -0
- package/README.md +263 -0
- package/android/build.gradle +114 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/comtappsosdk/ComTappSoSdkModule.kt +354 -0
- package/android/src/main/java/com/comtappsosdk/ComTappSoSdkPackage.kt +45 -0
- package/ios/ComTappSoSdk.h +62 -0
- package/ios/ComTappSoSdk.mm +343 -0
- package/ios/generated/ComTappSoSdkSpec/ComTappSoSdkSpec-generated.mm +81 -0
- package/ios/generated/ComTappSoSdkSpec/ComTappSoSdkSpec.h +84 -0
- package/ios/generated/ComTappSoSdkSpecJSI-generated.cpp +76 -0
- package/ios/generated/ComTappSoSdkSpecJSI.h +125 -0
- package/lib/module/NativeComTappSoSdk.js +5 -0
- package/lib/module/NativeComTappSoSdk.js.map +1 -0
- package/lib/module/Types.js +47 -0
- package/lib/module/Types.js.map +1 -0
- package/lib/module/events.js +17 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/index.js +58 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/NativeComTappSoSdk.d.ts +37 -0
- package/lib/typescript/src/NativeComTappSoSdk.d.ts.map +1 -0
- package/lib/typescript/src/Types.d.ts +145 -0
- package/lib/typescript/src/Types.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +10 -0
- package/lib/typescript/src/events.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +13 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +169 -0
- package/src/NativeComTappSoSdk.ts +46 -0
- package/src/Types.ts +149 -0
- package/src/events.ts +21 -0
- package/src/index.tsx +81 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
#import "ComTappSoSdk.h"
|
|
2
|
+
#import <React/RCTBridgeModule.h>
|
|
3
|
+
#import <React/RCTEventEmitter.h>
|
|
4
|
+
|
|
5
|
+
#import <Tapp/Tapp-Swift.h>
|
|
6
|
+
#import <Tapp/Tapp-umbrella.h>
|
|
7
|
+
|
|
8
|
+
#import <TappNetworking/Tapp-Networking-umbrella.h>
|
|
9
|
+
|
|
10
|
+
//
|
|
11
|
+
// For legacy builds, implement the renamed callback wrapper only in this file,
|
|
12
|
+
// so that its symbols are defined only once.
|
|
13
|
+
//
|
|
14
|
+
#if !defined(RCT_NEW_ARCH_ENABLED)
|
|
15
|
+
@implementation CTEventEmitterCallbackWrapper
|
|
16
|
+
// No additional implementation needed.
|
|
17
|
+
@end
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
//-------------------------------------------------------------
|
|
21
|
+
// MARK: - Internal EventEmitter
|
|
22
|
+
// This module sends events from native to JS.
|
|
23
|
+
//-------------------------------------------------------------
|
|
24
|
+
@interface EventEmitter : RCTEventEmitter <RCTBridgeModule>
|
|
25
|
+
+ (instancetype)shared;
|
|
26
|
+
@end
|
|
27
|
+
|
|
28
|
+
static NSString * const kOnDeferredLinkReceived = @"onDeferredLinkReceived";
|
|
29
|
+
static NSString * const kOnDidFailResolvingURL = @"onDidFailResolvingURL";
|
|
30
|
+
static NSString * const kOnTestListener = @"onTestListener";
|
|
31
|
+
static EventEmitter *sharedInstance = nil;
|
|
32
|
+
|
|
33
|
+
@implementation EventEmitter
|
|
34
|
+
|
|
35
|
+
RCT_EXPORT_MODULE(EventEmitter);
|
|
36
|
+
|
|
37
|
+
- (instancetype)init {
|
|
38
|
+
if ((self = [super init])) {
|
|
39
|
+
sharedInstance = self;
|
|
40
|
+
[self addListener:kOnDeferredLinkReceived];
|
|
41
|
+
[self addListener:kOnDidFailResolvingURL];
|
|
42
|
+
[self addListener:kOnTestListener];
|
|
43
|
+
}
|
|
44
|
+
return self;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
+ (instancetype)shared {
|
|
48
|
+
return sharedInstance;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
52
|
+
return YES;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
- (NSArray<NSString *> *)supportedEvents {
|
|
56
|
+
return @[kOnDeferredLinkReceived, kOnDidFailResolvingURL, kOnTestListener];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
- (void)startObserving {}
|
|
60
|
+
- (void)stopObserving {}
|
|
61
|
+
|
|
62
|
+
@end
|
|
63
|
+
|
|
64
|
+
//-------------------------------------------------------------
|
|
65
|
+
// MARK: - ComTappSoSdk Implementation
|
|
66
|
+
// This is your main native module bridging file.
|
|
67
|
+
//-------------------------------------------------------------
|
|
68
|
+
@implementation ComTappSoSdk
|
|
69
|
+
|
|
70
|
+
RCT_EXPORT_MODULE(ComTappSoSdk);
|
|
71
|
+
|
|
72
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
73
|
+
#if defined(RCT_NEW_ARCH_ENABLED)
|
|
74
|
+
NSLog(@"[ComTappSoSdk] Using **New Architecture** (TurboModule)");
|
|
75
|
+
#else
|
|
76
|
+
NSLog(@"[ComTappSoSdk] Using **Old Architecture** (Classic Bridge)");
|
|
77
|
+
#endif
|
|
78
|
+
return YES;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
#if defined(RCT_NEW_ARCH_ENABLED)
|
|
82
|
+
- (std::shared_ptr<facebook::react::TurboModule>)
|
|
83
|
+
getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
84
|
+
return std::make_shared<facebook::react::NativeComTappSoSdkSpecJSI>(params);
|
|
85
|
+
}
|
|
86
|
+
#endif
|
|
87
|
+
|
|
88
|
+
#if defined(RCT_NEW_ARCH_ENABLED)
|
|
89
|
+
RCT_EXPORT_METHOD(shouldProcess:(NSString *)deepLink
|
|
90
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
91
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
92
|
+
NSURL *url = [NSURL URLWithString:deepLink];
|
|
93
|
+
if (!url) {
|
|
94
|
+
NSLog(@"Invalid URL: %@", deepLink);
|
|
95
|
+
resolve(@(NO));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
BOOL result = [Tapp shouldProcessWithUrl:url];
|
|
99
|
+
NSLog(@"shouldProcess returned: %@ for URL: %@", result ? @"YES" : @"NO", deepLink);
|
|
100
|
+
resolve(@(result));
|
|
101
|
+
}
|
|
102
|
+
#else
|
|
103
|
+
RCT_EXPORT_METHOD(shouldProcess:(NSString *)deepLink
|
|
104
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
105
|
+
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
106
|
+
NSLog(@"[ComTappSoSdk - OLD ARCH] shouldProcess called with deepLink: %@", deepLink);
|
|
107
|
+
NSURL *url = [NSURL URLWithString:deepLink];
|
|
108
|
+
if (!url) {
|
|
109
|
+
NSLog(@"[ComTappSoSdk - OLD ARCH] Invalid URL => resolving false");
|
|
110
|
+
resolve(@(NO));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
BOOL result = [Tapp shouldProcessWithUrl:url];
|
|
114
|
+
NSLog(@"[ComTappSoSdk - OLD ARCH] shouldProcess => %@", result ? @"YES" : @"NO");
|
|
115
|
+
resolve(@(result));
|
|
116
|
+
}
|
|
117
|
+
#endif
|
|
118
|
+
|
|
119
|
+
RCT_EXPORT_METHOD(start:(NSString *)authToken
|
|
120
|
+
env:(NSString *)env
|
|
121
|
+
tappToken:(NSString *)tappToken) {
|
|
122
|
+
NSLog(@"[ComTappSoSdk] start called with authToken: %@, env: %@, tappToken: %@", authToken, env, tappToken);
|
|
123
|
+
NSString *bundleId = [[NSBundle mainBundle] bundleIdentifier];
|
|
124
|
+
TappConfiguration *config = [[TappConfiguration alloc]
|
|
125
|
+
initWithAuthToken:authToken
|
|
126
|
+
env:env
|
|
127
|
+
tappToken:tappToken
|
|
128
|
+
affiliateName:@"tapp"
|
|
129
|
+
bundleID:bundleId];
|
|
130
|
+
[Tapp startWithConfig:config delegate:self];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
RCT_EXPORT_METHOD(url:(NSString *)influencer
|
|
134
|
+
adGroup:(NSString *)adGroup
|
|
135
|
+
creative:(NSString *)creative
|
|
136
|
+
data:(NSDictionary *)data
|
|
137
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
138
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
139
|
+
AffiliateURLConfiguration *config = [[AffiliateURLConfiguration alloc]
|
|
140
|
+
initWithInfluencer:influencer
|
|
141
|
+
adgroup:adGroup
|
|
142
|
+
creative:creative
|
|
143
|
+
data:data];
|
|
144
|
+
[Tapp urlWithConfig:config completion:^(GeneratedURLResponse * _Nullable response, NSError * _Nullable error) {
|
|
145
|
+
if (error) {
|
|
146
|
+
reject(@"URL_ERROR", error.localizedDescription, error);
|
|
147
|
+
} else if (response) {
|
|
148
|
+
resolve(response.url.absoluteString);
|
|
149
|
+
} else {
|
|
150
|
+
reject(@"URL_ERROR", @"Unexpected error: response is nil", nil);
|
|
151
|
+
}
|
|
152
|
+
}];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
RCT_EXPORT_METHOD(handleTappEvent:(double)eventAction
|
|
156
|
+
customValue:(NSString *)customValue
|
|
157
|
+
metadata:(NSDictionary *)metadata
|
|
158
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
159
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
160
|
+
@try {
|
|
161
|
+
NSString *eventActionName = nil;
|
|
162
|
+
if (eventAction == 0) {
|
|
163
|
+
eventActionName = (customValue.length > 0 ? customValue : @"custom_event_autogenerated");
|
|
164
|
+
} else {
|
|
165
|
+
eventActionName = [self mapEventAction:eventAction];
|
|
166
|
+
}
|
|
167
|
+
if (!eventActionName) {
|
|
168
|
+
reject(@"INVALID_ACTION", [NSString stringWithFormat:@"Invalid event action: %.2f", eventAction], nil);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
TappEvent *event = [[TappEvent alloc] initWithEventActionName:eventActionName metadata:metadata];
|
|
172
|
+
NSLog(@"handleTappEvent => %@ metadata: %@", eventActionName, metadata);
|
|
173
|
+
[Tapp handleTappEventWithEvent:event];
|
|
174
|
+
resolve([NSString stringWithFormat:@"Tapp event handled: %f", eventAction]);
|
|
175
|
+
}
|
|
176
|
+
@catch (NSException *exception) {
|
|
177
|
+
reject(@"HANDLE_EVENT_ERROR", exception.reason, nil);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Helper method to convert TappDeferredLinkData to a JSON-safe NSDictionary
|
|
182
|
+
// Returns a cross-platform consistent object that matches Android's response format
|
|
183
|
+
- (NSDictionary *)dictionaryFromLinkData:(TappDeferredLinkData *)linkData {
|
|
184
|
+
if (!linkData) {
|
|
185
|
+
// Return empty/default state (no error, just no data)
|
|
186
|
+
return @{
|
|
187
|
+
@"error": @(NO),
|
|
188
|
+
@"message": [NSNull null],
|
|
189
|
+
@"tappUrl": [NSNull null],
|
|
190
|
+
@"attrTappUrl": [NSNull null],
|
|
191
|
+
@"influencer": [NSNull null],
|
|
192
|
+
@"data": @{},
|
|
193
|
+
@"isFirstSession": @(NO)
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
NSDictionary *result = @{
|
|
197
|
+
@"error": @(NO),
|
|
198
|
+
@"message": [NSNull null],
|
|
199
|
+
@"tappUrl": linkData.tappURL.absoluteString ?: [NSNull null],
|
|
200
|
+
@"attrTappUrl": linkData.attributedTappURL.absoluteString ?: [NSNull null],
|
|
201
|
+
@"influencer": linkData.influencer ?: [NSNull null],
|
|
202
|
+
@"data": linkData.data ?: @{},
|
|
203
|
+
@"isFirstSession": @(linkData.isFirstSession)
|
|
204
|
+
};
|
|
205
|
+
NSLog(@"[ComTappSoSdk] dictionaryFromLinkData => %@", result);
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Helper to create an error response object (matches Android format)
|
|
210
|
+
- (NSDictionary *)errorResponseWithMessage:(NSString *)message {
|
|
211
|
+
return @{
|
|
212
|
+
@"error": @(YES),
|
|
213
|
+
@"message": message ?: @"Unknown error",
|
|
214
|
+
@"tappUrl": [NSNull null],
|
|
215
|
+
@"attrTappUrl": [NSNull null],
|
|
216
|
+
@"influencer": [NSNull null],
|
|
217
|
+
@"data": @{},
|
|
218
|
+
@"isFirstSession": @(NO)
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
RCT_EXPORT_METHOD(fetchLinkData:(NSString *)deepLink
|
|
223
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
224
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
225
|
+
// ONLY reject for invalid JS input (programmer error, not SDK state)
|
|
226
|
+
NSURL *url = [NSURL URLWithString:deepLink];
|
|
227
|
+
if (!url) {
|
|
228
|
+
reject(@"INVALID_URL", @"The provided deepLink is not a valid URL", nil);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
[Tapp fetchLinkDataFor:url completion:^(TappDeferredLinkData * _Nullable linkData, NSError * _Nullable error) {
|
|
233
|
+
if (error) {
|
|
234
|
+
// SDK/service error → resolve with error object (matches Android)
|
|
235
|
+
NSLog(@"[ComTappSoSdk] fetchLinkData SDK error: %@", error);
|
|
236
|
+
NSDictionary *errorResponse = [self errorResponseWithMessage:error.localizedDescription];
|
|
237
|
+
resolve(errorResponse);
|
|
238
|
+
} else if (linkData) {
|
|
239
|
+
// Success → resolve with data
|
|
240
|
+
NSDictionary *dict = [self dictionaryFromLinkData:linkData];
|
|
241
|
+
resolve(dict);
|
|
242
|
+
} else {
|
|
243
|
+
// No data, no error → resolve with empty state
|
|
244
|
+
NSLog(@"[ComTappSoSdk] fetchLinkData returned nil data without error");
|
|
245
|
+
NSDictionary *emptyResponse = [self dictionaryFromLinkData:nil];
|
|
246
|
+
resolve(emptyResponse);
|
|
247
|
+
}
|
|
248
|
+
}];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
RCT_EXPORT_METHOD(fetchOriginLinkData:(RCTPromiseResolveBlock)resolve
|
|
252
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
253
|
+
[Tapp fetchOriginLinkDataWithCompletion:^(TappDeferredLinkData * _Nullable linkData, NSError * _Nullable error) {
|
|
254
|
+
if (error) {
|
|
255
|
+
// SDK/service error → resolve with error object (matches Android)
|
|
256
|
+
NSLog(@"[ComTappSoSdk] fetchOriginLinkData SDK error: %@", error);
|
|
257
|
+
NSDictionary *errorResponse = [self errorResponseWithMessage:error.localizedDescription];
|
|
258
|
+
resolve(errorResponse);
|
|
259
|
+
} else if (linkData) {
|
|
260
|
+
// Success → resolve with data
|
|
261
|
+
NSDictionary *dict = [self dictionaryFromLinkData:linkData];
|
|
262
|
+
resolve(dict);
|
|
263
|
+
} else {
|
|
264
|
+
// No data, no error → resolve with empty state
|
|
265
|
+
NSLog(@"[ComTappSoSdk] fetchOriginLinkData returned nil data without error");
|
|
266
|
+
NSDictionary *emptyResponse = [self dictionaryFromLinkData:nil];
|
|
267
|
+
resolve(emptyResponse);
|
|
268
|
+
}
|
|
269
|
+
}];
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
RCT_EXPORT_METHOD(simulateTestEvent) {
|
|
273
|
+
NSLog(@"[ComTappSoSdk] simulateTestEvent is unsupported on iOS");
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ----------------------------------------------------------------------
|
|
277
|
+
// (Keep all existing methods below unchanged.)
|
|
278
|
+
// ----------------------------------------------------------------------
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
#pragma mark - TappDelegate Methods
|
|
282
|
+
|
|
283
|
+
- (void)didOpenApplicationWith:(TappDeferredLinkData *)data {
|
|
284
|
+
NSDictionary *result = [self dictionaryFromLinkData:data];
|
|
285
|
+
[[EventEmitter shared] sendEventWithName:@"onDeferredLinkReceived" body:result];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
- (void)didFailResolvingURLWithUrl:(NSURL *)url error:(NSError *)error {
|
|
289
|
+
NSDictionary *result = @{
|
|
290
|
+
@"url": url.absoluteString ?: @"",
|
|
291
|
+
@"error": error.localizedDescription ?: @""
|
|
292
|
+
};
|
|
293
|
+
[[EventEmitter shared] sendEventWithName:@"onDidFailResolvingURL" body:result];
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
- (NSString *)mapEventAction:(double)eventAction {
|
|
297
|
+
switch ((int)eventAction) {
|
|
298
|
+
case 1: return @"tapp_add_payment_info";
|
|
299
|
+
case 2: return @"tapp_add_to_cart";
|
|
300
|
+
case 3: return @"tapp_add_to_wishlist";
|
|
301
|
+
case 4: return @"tapp_complete_registration";
|
|
302
|
+
case 5: return @"tapp_contact";
|
|
303
|
+
case 6: return @"tapp_customize_product";
|
|
304
|
+
case 7: return @"tapp_donate";
|
|
305
|
+
case 8: return @"tapp_find_location";
|
|
306
|
+
case 9: return @"tapp_initiate_checkout";
|
|
307
|
+
case 10: return @"tapp_generate_lead";
|
|
308
|
+
case 11: return @"tapp_purchase";
|
|
309
|
+
case 12: return @"tapp_schedule";
|
|
310
|
+
case 13: return @"tapp_search";
|
|
311
|
+
case 14: return @"tapp_start_trial";
|
|
312
|
+
case 15: return @"tapp_submit_application";
|
|
313
|
+
case 16: return @"tapp_subscribe";
|
|
314
|
+
case 17: return @"tapp_view_content";
|
|
315
|
+
case 18: return @"tapp_click_button";
|
|
316
|
+
case 19: return @"tapp_download_file";
|
|
317
|
+
case 20: return @"tapp_join_group";
|
|
318
|
+
case 21: return @"tapp_achieve_level";
|
|
319
|
+
case 22: return @"tapp_create_group";
|
|
320
|
+
case 23: return @"tapp_create_role";
|
|
321
|
+
case 24: return @"tapp_link_click";
|
|
322
|
+
case 25: return @"tapp_link_impression";
|
|
323
|
+
case 26: return @"tapp_apply_for_loan";
|
|
324
|
+
case 27: return @"tapp_loan_approval";
|
|
325
|
+
case 28: return @"tapp_loan_disbursal";
|
|
326
|
+
case 29: return @"tapp_login";
|
|
327
|
+
case 30: return @"tapp_rate";
|
|
328
|
+
case 31: return @"tapp_spend_credits";
|
|
329
|
+
case 32: return @"tapp_unlock_achievement";
|
|
330
|
+
case 33: return @"tapp_add_shipping_info";
|
|
331
|
+
case 34: return @"tapp_earn_virtual_currency";
|
|
332
|
+
case 35: return @"tapp_start_level";
|
|
333
|
+
case 36: return @"tapp_complete_level";
|
|
334
|
+
case 37: return @"tapp_post_score";
|
|
335
|
+
case 38: return @"tapp_select_content";
|
|
336
|
+
case 39: return @"tapp_begin_tutorial";
|
|
337
|
+
case 40: return @"tapp_complete_tutorial";
|
|
338
|
+
default: return nil;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
@end
|
|
343
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#import "ComTappSoSdkSpec.h"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@implementation NativeComTappSoSdkSpecBase
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
|
|
21
|
+
{
|
|
22
|
+
_eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
|
|
23
|
+
}
|
|
24
|
+
@end
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
namespace facebook::react {
|
|
28
|
+
|
|
29
|
+
static facebook::jsi::Value __hostFunction_NativeComTappSoSdkSpecJSI_start(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
30
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "start", @selector(start:env:tappToken:), args, count);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static facebook::jsi::Value __hostFunction_NativeComTappSoSdkSpecJSI_url(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
34
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "url", @selector(url:adGroup:creative:data:resolve:reject:), args, count);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static facebook::jsi::Value __hostFunction_NativeComTappSoSdkSpecJSI_handleTappEvent(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
38
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "handleTappEvent", @selector(handleTappEvent:customValue:metadata:resolve:reject:), args, count);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static facebook::jsi::Value __hostFunction_NativeComTappSoSdkSpecJSI_fetchLinkData(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
42
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "fetchLinkData", @selector(fetchLinkData:resolve:reject:), args, count);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static facebook::jsi::Value __hostFunction_NativeComTappSoSdkSpecJSI_shouldProcess(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
46
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "shouldProcess", @selector(shouldProcess:resolve:reject:), args, count);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static facebook::jsi::Value __hostFunction_NativeComTappSoSdkSpecJSI_fetchOriginLinkData(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
50
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "fetchOriginLinkData", @selector(fetchOriginLinkData:reject:), args, count);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static facebook::jsi::Value __hostFunction_NativeComTappSoSdkSpecJSI_simulateTestEvent(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
54
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "simulateTestEvent", @selector(simulateTestEvent), args, count);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
NativeComTappSoSdkSpecJSI::NativeComTappSoSdkSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
58
|
+
: ObjCTurboModule(params) {
|
|
59
|
+
|
|
60
|
+
methodMap_["start"] = MethodMetadata {3, __hostFunction_NativeComTappSoSdkSpecJSI_start};
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
methodMap_["url"] = MethodMetadata {4, __hostFunction_NativeComTappSoSdkSpecJSI_url};
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
methodMap_["handleTappEvent"] = MethodMetadata {3, __hostFunction_NativeComTappSoSdkSpecJSI_handleTappEvent};
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
methodMap_["fetchLinkData"] = MethodMetadata {1, __hostFunction_NativeComTappSoSdkSpecJSI_fetchLinkData};
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
methodMap_["shouldProcess"] = MethodMetadata {1, __hostFunction_NativeComTappSoSdkSpecJSI_shouldProcess};
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
methodMap_["fetchOriginLinkData"] = MethodMetadata {0, __hostFunction_NativeComTappSoSdkSpecJSI_fetchOriginLinkData};
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
methodMap_["simulateTestEvent"] = MethodMetadata {0, __hostFunction_NativeComTappSoSdkSpecJSI_simulateTestEvent};
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef __cplusplus
|
|
15
|
+
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// Avoid multiple includes of ComTappSoSdkSpec symbols
|
|
19
|
+
#ifndef ComTappSoSdkSpec_H
|
|
20
|
+
#define ComTappSoSdkSpec_H
|
|
21
|
+
|
|
22
|
+
#import <Foundation/Foundation.h>
|
|
23
|
+
#import <RCTRequired/RCTRequired.h>
|
|
24
|
+
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
25
|
+
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
|
|
26
|
+
#import <React/RCTBridgeModule.h>
|
|
27
|
+
#import <React/RCTCxxConvert.h>
|
|
28
|
+
#import <React/RCTManagedPointer.h>
|
|
29
|
+
#import <ReactCommon/RCTTurboModule.h>
|
|
30
|
+
#import <optional>
|
|
31
|
+
#import <vector>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
35
|
+
|
|
36
|
+
@protocol NativeComTappSoSdkSpec <RCTBridgeModule, RCTTurboModule>
|
|
37
|
+
|
|
38
|
+
- (void)start:(NSString *)authToken
|
|
39
|
+
env:(NSString *)env
|
|
40
|
+
tappToken:(NSString *)tappToken;
|
|
41
|
+
- (void)url:(NSString *)influencer
|
|
42
|
+
adGroup:(NSString *)adGroup
|
|
43
|
+
creative:(NSString *)creative
|
|
44
|
+
data:(NSDictionary *)data
|
|
45
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
46
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
47
|
+
- (void)handleTappEvent:(double)eventAction
|
|
48
|
+
customValue:(NSString *)customValue
|
|
49
|
+
metadata:(NSDictionary *)metadata
|
|
50
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
51
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
52
|
+
- (void)fetchLinkData:(NSString *)deepLink
|
|
53
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
54
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
55
|
+
- (void)shouldProcess:(NSString *)deepLink
|
|
56
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
57
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
58
|
+
- (void)fetchOriginLinkData:(RCTPromiseResolveBlock)resolve
|
|
59
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
60
|
+
- (void)simulateTestEvent;
|
|
61
|
+
|
|
62
|
+
@end
|
|
63
|
+
|
|
64
|
+
@interface NativeComTappSoSdkSpecBase : NSObject {
|
|
65
|
+
@protected
|
|
66
|
+
facebook::react::EventEmitterCallback _eventEmitterCallback;
|
|
67
|
+
}
|
|
68
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@end
|
|
72
|
+
|
|
73
|
+
namespace facebook::react {
|
|
74
|
+
/**
|
|
75
|
+
* ObjC++ class for module 'NativeComTappSoSdk'
|
|
76
|
+
*/
|
|
77
|
+
class JSI_EXPORT NativeComTappSoSdkSpecJSI : public ObjCTurboModule {
|
|
78
|
+
public:
|
|
79
|
+
NativeComTappSoSdkSpecJSI(const ObjCTurboModule::InitParams ¶ms);
|
|
80
|
+
};
|
|
81
|
+
} // namespace facebook::react
|
|
82
|
+
|
|
83
|
+
NS_ASSUME_NONNULL_END
|
|
84
|
+
#endif // ComTappSoSdkSpec_H
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "ComTappSoSdkSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeComTappSoSdkCxxSpecJSI_start(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
static_cast<NativeComTappSoSdkCxxSpecJSI *>(&turboModule)->start(
|
|
16
|
+
rt,
|
|
17
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
18
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
19
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
20
|
+
);
|
|
21
|
+
return jsi::Value::undefined();
|
|
22
|
+
}
|
|
23
|
+
static jsi::Value __hostFunction_NativeComTappSoSdkCxxSpecJSI_url(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
24
|
+
return static_cast<NativeComTappSoSdkCxxSpecJSI *>(&turboModule)->url(
|
|
25
|
+
rt,
|
|
26
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
27
|
+
count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)),
|
|
28
|
+
count <= 2 || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asString(rt)),
|
|
29
|
+
count <= 3 || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asObject(rt))
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
static jsi::Value __hostFunction_NativeComTappSoSdkCxxSpecJSI_handleTappEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
33
|
+
return static_cast<NativeComTappSoSdkCxxSpecJSI *>(&turboModule)->handleTappEvent(
|
|
34
|
+
rt,
|
|
35
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
36
|
+
count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)),
|
|
37
|
+
count <= 2 || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt))
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
static jsi::Value __hostFunction_NativeComTappSoSdkCxxSpecJSI_fetchLinkData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
41
|
+
return static_cast<NativeComTappSoSdkCxxSpecJSI *>(&turboModule)->fetchLinkData(
|
|
42
|
+
rt,
|
|
43
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
static jsi::Value __hostFunction_NativeComTappSoSdkCxxSpecJSI_shouldProcess(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
47
|
+
return static_cast<NativeComTappSoSdkCxxSpecJSI *>(&turboModule)->shouldProcess(
|
|
48
|
+
rt,
|
|
49
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
static jsi::Value __hostFunction_NativeComTappSoSdkCxxSpecJSI_fetchOriginLinkData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
53
|
+
return static_cast<NativeComTappSoSdkCxxSpecJSI *>(&turboModule)->fetchOriginLinkData(
|
|
54
|
+
rt
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
static jsi::Value __hostFunction_NativeComTappSoSdkCxxSpecJSI_simulateTestEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
58
|
+
static_cast<NativeComTappSoSdkCxxSpecJSI *>(&turboModule)->simulateTestEvent(
|
|
59
|
+
rt
|
|
60
|
+
);
|
|
61
|
+
return jsi::Value::undefined();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
NativeComTappSoSdkCxxSpecJSI::NativeComTappSoSdkCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
65
|
+
: TurboModule("ComTappSoSdk", jsInvoker) {
|
|
66
|
+
methodMap_["start"] = MethodMetadata {3, __hostFunction_NativeComTappSoSdkCxxSpecJSI_start};
|
|
67
|
+
methodMap_["url"] = MethodMetadata {4, __hostFunction_NativeComTappSoSdkCxxSpecJSI_url};
|
|
68
|
+
methodMap_["handleTappEvent"] = MethodMetadata {3, __hostFunction_NativeComTappSoSdkCxxSpecJSI_handleTappEvent};
|
|
69
|
+
methodMap_["fetchLinkData"] = MethodMetadata {1, __hostFunction_NativeComTappSoSdkCxxSpecJSI_fetchLinkData};
|
|
70
|
+
methodMap_["shouldProcess"] = MethodMetadata {1, __hostFunction_NativeComTappSoSdkCxxSpecJSI_shouldProcess};
|
|
71
|
+
methodMap_["fetchOriginLinkData"] = MethodMetadata {0, __hostFunction_NativeComTappSoSdkCxxSpecJSI_fetchOriginLinkData};
|
|
72
|
+
methodMap_["simulateTestEvent"] = MethodMetadata {0, __hostFunction_NativeComTappSoSdkCxxSpecJSI_simulateTestEvent};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
} // namespace facebook::react
|