Skip to content

Commit e7ea599

Browse files
ATT Support
1 parent b448b5b commit e7ea599

File tree

8 files changed

+1871
-593
lines changed

8 files changed

+1871
-593
lines changed

.DS_Store

0 Bytes
Binary file not shown.

ios/RNMParticle/RNMParticle.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ + (void)load {
3939
[[MParticle sharedInstance] logScreen:screenName eventInfo:attributes];
4040
}
4141

42+
RCT_EXPORT_METHOD(setATTStatus:(NSInteger)status withATTStatusTimestampMillis:(NSNumber *)timestamp)
43+
{
44+
[[MParticle sharedInstance] setATTStatus:status withATTStatusTimestampMillis:timestamp];
45+
}
46+
4247
RCT_EXPORT_METHOD(setOptOut:(BOOL)optOut)
4348
{
4449
[[MParticle sharedInstance] setOptOut:optOut];
@@ -531,10 +536,12 @@ + (MPIdentityApiRequest *)MPIdentityApiRequest:(id)json {
531536
request.email = json[@"email"];
532537
} else if ([key isEqualToString:@"customerId"]) {
533538
request.customerId = json[@"customerId"];
534-
} else {
539+
} else if ((key.intValue <= MPIdentityDeviceApplicationStamp) && (MPIdentityOther <= key.intValue)) {
535540
NSString *value = json[key];
536541
MPIdentity identityType = (MPIdentity)key.intValue;
537542
[request setIdentity:value identityType:identityType];
543+
} else {
544+
NSAssert(NO, @"Invalid identity request - Please only use MPIdentity keys");
538545
}
539546
}
540547
return request;

js/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ const logScreenEvent = (screenName, attributes = null) => {
8080
NativeModules.MParticle.logScreenEvent(screenName, attributes)
8181
}
8282

83+
const setATTStatus = (status, timestamp = null) => {
84+
NativeModules.MParticle.setATTStatus(status, timestamp)
85+
}
86+
8387
const setOptOut = (optOut) => {
8488
NativeModules.MParticle.setOptOut(optOut)
8589
}
@@ -615,6 +619,7 @@ const MParticle = {
615619
logMPEvent,
616620
logCommerceEvent,
617621
logScreenEvent,
622+
setATTStatus,
618623
setOptOut,
619624
getOptOut,
620625
addGDPRConsentState,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"homepage": "https://www.mparticle.com",
55
"license": "Apache-2.0",
66
"repository": "mParticle/react-native-mparticle",
7-
"version": "2.4.6",
7+
"version": "2.4.7",
88
"main": "js/index.js",
99
"scripts": {
1010
"test": "./node_modules/standard/bin/cmd.js",

sample/ios/MParticleSample.xcodeproj/project.pbxproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@
644644
developmentRegion = English;
645645
hasScannedForEncodings = 0;
646646
knownRegions = (
647+
English,
647648
en,
648649
Base,
649650
);
@@ -1202,7 +1203,7 @@
12021203
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
12031204
GCC_WARN_UNUSED_FUNCTION = YES;
12041205
GCC_WARN_UNUSED_VARIABLE = YES;
1205-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1206+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
12061207
MTL_ENABLE_DEBUG_INFO = YES;
12071208
ONLY_ACTIVE_ARCH = YES;
12081209
SDKROOT = iphoneos;
@@ -1240,7 +1241,7 @@
12401241
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
12411242
GCC_WARN_UNUSED_FUNCTION = YES;
12421243
GCC_WARN_UNUSED_VARIABLE = YES;
1243-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1244+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
12441245
MTL_ENABLE_DEBUG_INFO = NO;
12451246
SDKROOT = iphoneos;
12461247
VALIDATE_PRODUCT = YES;

sample/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ target 'MParticleSample' do
1313
#
1414
# (See https://github.com/mparticle/mparticle/apple-sdk for the latest version)
1515
#
16-
pod 'mParticle-Apple-SDK', '~> 7'
16+
pod 'mParticle-Apple-SDK', :path => '../../../../mparticle-apple-sdk'
1717

1818
#
1919
# And, if you want to include kits, you can do so as follows:

sample/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"react": "*",
1111
"react-native": "^0.53.3",
12-
"react-native-mparticle": "2.4.6"
12+
"react-native-mparticle": "2.4.7"
1313
},
1414
"devDependencies": {
1515
"babel-jest": "18.0.0",

0 commit comments

Comments
 (0)