Skip to content

Commit 07a981e

Browse files
Fix Nullabity Issue for ATT Timestamp
1 parent 5d448b7 commit 07a981e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ios/RNMParticle/RNMParticle.m

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

42-
RCT_EXPORT_METHOD(setATTStatus:(NSInteger)status withATTStatusTimestampMillis:(NSNumber *)timestamp)
42+
RCT_EXPORT_METHOD(setATTStatus:(NSInteger)status withATTStatusTimestampMillis:(nonnull NSNumber *)timestamp)
4343
{
4444
[[MParticle sharedInstance] setATTStatus:status withATTStatusTimestampMillis:timestamp];
4545
}
4646

47+
RCT_EXPORT_METHOD(setATTStatus:(NSInteger)status)
48+
{
49+
[[MParticle sharedInstance] setATTStatus:status withATTStatusTimestampMillis:nil];
50+
}
51+
4752
RCT_EXPORT_METHOD(setOptOut:(BOOL)optOut)
4853
{
4954
[[MParticle sharedInstance] setOptOut:optOut];

js/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ const logScreenEvent = (screenName, attributes = null) => {
101101
}
102102

103103
// Use ATTAuthStatus constants for status
104-
const setATTStatus = (status, timestamp = null) => {
104+
const setATTStatus = (status) => {
105+
NativeModules.MParticle.setATTStatus(status)
106+
}
107+
108+
const setATTStatusWithCustomTimestamp = (status, timestamp) => {
105109
NativeModules.MParticle.setATTStatus(status, timestamp)
106110
}
107111

@@ -651,6 +655,7 @@ const MParticle = {
651655
logCommerceEvent,
652656
logScreenEvent,
653657
setATTStatus,
658+
setATTStatusWithCustomTimestamp,
654659
setOptOut,
655660
getOptOut,
656661
addGDPRConsentState,

0 commit comments

Comments
 (0)