Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
164 stars 142 forks source link

ABKRequestProcessingPolicy.manualRequestProcessing not respected #328

Closed ashender closed 2 years ago

ashender commented 2 years ago

Report

 Appboy.start(
            withApiKey: config.apiKey,
            in: application,
            withLaunchOptions: launchOptions,
            withAppboyOptions: [
                ABKEndpointKey: config.endpoint,
                ABKRequestProcessingPolicyOptionKey: ABKRequestProcessingPolicy.manualRequestProcessing
            ]
        )

log prints:

2021-12-23 16:36:04.025742+1100 someApp[48628:12153591] [APPBOY][DEBUG] -[ABKPersistentData setLogLevelFromPlist] Braze log level set to:0
2021-12-23 16:36:04.033760+1100 someApp[48628:12153591] [APPBOY][DEBUG] -[ABKManager initWithApiKey:requestProcessingPolicy:persistentData:locationManagerDelegate:networkFlushInterval:sdkFlavor:deviceAllowlist:disableNetworkRequests:] Initialized shared ABKManager instance with request processing policy: ABKAutomaticRequestProcessing and api key xxxxxxx

so request processing policy is still automatic, although specified as manual.

if I set it directly

Appboy.sharedInstance()?.requestProcessingPolicy = .manualRequestProcessing

Log prints that it is manual. But at the same time events still being sent to the braze backend when I background and foreground app.

Describe your environment.

Info Value
Platform Name iOS
Platform Version ios 14.4
SDK Version 4.3.4
Integration Method SPM
Xcode Version Xcode 13.1
Computer Processor intel-based
Repro rate All the time (100%)
hokstuff commented 2 years ago

Hi @ashender,

Thanks for reporting this! Do to the nature of how Swift processes Dictionaries, you will actually need to append .rawValue to the entry in order for it to be processed correctly:

ABKRequestProcessingPolicyOptionKey: ABKRequestProcessingPolicy.manualRequestProcessing.rawValue

Alternatively, you can create your own enum in your code and reference it without the .rawValue by following these docs here.

Please note that once you use Manual, some requests are still sent to the Braze backend automatically. You can read more in our documentation in the code here.

Let us know if you run into any issues - thank you!

Best, Daniel

ashender commented 2 years ago

On 24 Dec 2021, at 11:14 am, Daniel Hok @.***> wrote:

Hi @ashender https://www.google.com/url?q=https://github.com/ashender&source=gmail-imap&ust=1640909666000000&usg=AOvVaw0sVPUhEr5zbASreg7Ew1t_,

Thanks for reporting this! Do to the nature of how Swift processes Dictionaries, you will actually need to append .rawValue to the entry in order for it to be processed correctly:

ABKRequestProcessingPolicyOptionKey: ABKRequestProcessingPolicy.manualRequestProcessing.rawValue We will update any docs and sample apps on our end to ensure that the integration steps are accurate.

Also, please note that once you use Manual, some requests are still sent to the Braze backend automatically. You can read more in our documentation in the code here https://www.google.com/url?q=https://github.com/Appboy/AppboyKit/blob/d6e19805ebac3c3b69c4af74e808f0ab8aeee3a9/AppboyKit/AppboyKit/Appboy.h%23L185&source=gmail-imap&ust=1640909666000000&usg=AOvVaw295O3jjrzW2Apo1YE95p60.

Let us know if you run into any issues - thank you!

Best, Daniel

— Reply to this email directly, view it on GitHub https://www.google.com/url?q=https://github.com/Appboy/appboy-ios-sdk/issues/328%23issuecomment-1000574493&source=gmail-imap&ust=1640909666000000&usg=AOvVaw33pV-mFjUCgsbl5PA8K1Iu, or unsubscribe https://www.google.com/url?q=https://github.com/notifications/unsubscribe-auth/ABL67TFWE47MRUIXTANN6QDUSO3ODANCNFSM5KUAX2LQ&source=gmail-imap&ust=1640909666000000&usg=AOvVaw1VGZ03bFOUE4rOIhyhaXOR. Triage notifications on the go with GitHub Mobile for iOS https://www.google.com/url?q=https://apps.apple.com/app/apple-store/id1477376905?ct%3Dnotification-email%26mt%3D8%26pt%3D524675&source=gmail-imap&ust=1640909666000000&usg=AOvVaw1Z_lePVQp-kj_nWUgfPPMj or Android https://www.google.com/url?q=https://play.google.com/store/apps/details?id%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&source=gmail-imap&ust=1640909666000000&usg=AOvVaw1mGxbjix82SdSTm4JDKlDe. You are receiving this because you were mentioned.

Hi Daniel, Thanks for the reply

The doc link is broken. I found following description in the Appboy.h in the iOS sdk: ABKManualRequestProcessing - The same as ABKAutomaticRequestProcessing, except that updates to

When I testing it in the app with Braze debug logs enabled and in the Braze event log in the developer console I can still see custom events arriving.

2021-12-24 11:25:39.392507+1100 xxx[51955:12412221] [APPBOY][DEBUG] -[ABKManager initWithApiKey:requestProcessingPolicy:persistentData:locationManagerDelegate:networkFlushInterval:sdkFlavor:deviceAllowlist:disableNetworkRequests:] Initialized shared ABKManager instance with request processing policy: ABKManualRequestProcessing and api key

Some time later in the same session: 2021-12-24 11:38:10.931368+1100 xxx[52093:12419287] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] Request connection body: And I can see all my custom events logged with logCustomEvent(name: name, properties: properties). Please let me know if I can set up sdk so that it will not send custom user event until I enable it. -- https://www.canva.com/Empowering the world to design Share accurate information on COVID-19 and spread messages of support to your community. Here are some resources https://about.canva.com/coronavirus-awareness-collection/?utm_medium=pr&utm_source=news&utm_campaign=covid19_templates that can help. https://twitter.com/canva https://facebook.com/canva https://au.linkedin.com/company/canva https://twitter.com/canva  https://facebook.com/canva  https://au.linkedin.com/company/canva  https://instagram.com/canva