urbanairship / ios-library

Urban Airship iOS SDK
http://urbanairship.com
Apache License 2.0
478 stars 265 forks source link

Can not set urlAllowList in v17.0.2 #371

Closed neriusv closed 1 year ago

neriusv commented 1 year ago

❗For how-to inquiries involving Airship functionality or use cases, please contact (support)[https://support.airship.com/].

Preliminary Info

What Airship dependencies are you using?

AirshipCore 17.0.2

What are the versions of any relevant development tools you are using?

Xcode 14.3.1

Report

What unexpected behavior are you seeing?

Setting AirshipConfig.urlAllowList and/or AirshipConfig.urlAllowListScopeOpenURL results error message and URL allow list defaulting to *:

AirshipCore/URLAllowList.swift allowListWithConfig(_:) [Line 114] 🚨Airship Implementation Error🚨: The Airship config options is missing URL allow list rules for SCOPE_OPEN that controls what external URLs are able to be opened externally or loaded in a web view by Airship. By default, all URLs will be allowed. To suppress this error, specify the config urlAllowListScopeOpenURL = [*] to keep the defaults, or by providing a list of rules that your app expects. See https://docs.airship.com/platform/mobile/setup/sdk/ios/#url-allow-list for more information.

What is the expected behavior?

urlAllowList should be set correctly

What are the steps to reproduce the unexpected behavior?

Configure Airship and try calling Airship.takeOff():

let config = AirshipConfig.default()
config.urlAllowList = [
               "https://example.com/*",
           ]
// Set any other configuration
Airship.takeOff(config, launchOptions: launchOptions)

Seems like the issue is in commonTakeOff because config.isURLAllowListSet is true but resolvedConfig.isURLAllowListSet becomes false.

Do you have logging for the issue?

AirshipCore/URLAllowList.swift allowListWithConfig(_:) [Line 114] 🚨Airship Implementation Error🚨: The Airship config options is missing URL allow list rules for SCOPE_OPEN that controls what external URLs are able to be opened externally or loaded in a web view by Airship. By default, all URLs will be allowed. To suppress this error, specify the config urlAllowListScopeOpenURL = [*] to keep the defaults, or by providing a list of rules that your app expects. See https://docs.airship.com/platform/mobile/setup/sdk/ios/#url-allow-list for more information.

rlepinski commented 1 year ago

Thanks for the report, working on this now

rlepinski commented 1 year ago

Fixed in 17.0.3