Skip to content

Commit 2b4ce8a

Browse files
committed
Added missing parameter for setRequiresConsent
1 parent b13666c commit 2b4ce8a

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Countly.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ Countly.userData.pullValue = function(keyName, keyValue){
319319
};
320320

321321
// GDPR
322-
Countly.setRequiresConsent = function(){
323-
CountlyReactNative.setRequiresConsent([]);
322+
Countly.setRequiresConsent = function(flag){
323+
CountlyReactNative.setRequiresConsent([flag]);
324324
}
325325

326326
Countly.giveConsent = function(args){

android/src/main/java/ly/count/android/sdk/react/CountlyReactNative.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ public void userData_pullValue(ReadableArray args){
488488
// GDPR
489489
@ReactMethod
490490
public void setRequiresConsent(ReadableArray args){
491-
Countly.sharedInstance().setRequiresConsent(true);
491+
Boolean consentFlag = args.getBoolean(0);
492+
Countly.sharedInstance().setRequiresConsent(consentFlag);
492493
}
493494

494495
@ReactMethod

example/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class AwesomeProject extends Component {
183183
};
184184

185185
setRequiresConsent(){
186-
Countly.setRequiresConsent();
186+
Countly.setRequiresConsent(true);
187187
}
188188

189189
giveEventsConsent(){

ios/src/CountlyReactNative.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ @implementation CountlyReactNative
460460
if (config == nil){
461461
config = CountlyConfig.new;
462462
}
463-
config.requiresConsent = YES;
463+
BOOL consentFlag = [[arguments objectAtIndex:0] boolValue];
464+
config.requiresConsent = consentFlag;
464465
}
465466

466467
RCT_EXPORT_METHOD(giveConsent:(NSArray*)arguments)

0 commit comments

Comments
 (0)