Skip to content

Support remote updates to Target property token#121

Merged
swarna04 merged 3 commits intoadobe:dev-3.3.0from
swarna04:MOB-16942
Sep 8, 2022
Merged

Support remote updates to Target property token#121
swarna04 merged 3 commits intoadobe:dev-3.3.0from
swarna04:MOB-16942

Conversation

@swarna04
Copy link
Copy Markdown
Contributor

@swarna04 swarna04 commented Aug 31, 2022

Description

Support remote property token updates with attach data rule:
The property token "at_property" can be provided in the JSON data to be attached to Target events (prefetch, execute, locations displayed or location clicked). Also, added the logic to remove any property tokens passed in mbox parameters (supported with Target iOS 2.x SDK).

The order or precedence will be as follows:
Property token configured in the extension card > Property token passed in Event Data

Note: Do not configure the property token in Target extension card on Data Collection UI if you wish to update it with attach data rule.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@swarna04 swarna04 requested a review from sbenedicadb August 31, 2022 18:49
@sbenedicadb
Copy link
Copy Markdown
Member

The order or precedence will be as follows:
Property token configured in the extension card > Property token passed in Event Data

Should we change this so the event data value has precedence over the configured value? Seems like it's being used as an override, which in my mind means it should have higher priority. WDYT?

@swarna04
Copy link
Copy Markdown
Contributor Author

swarna04 commented Sep 1, 2022

The order or precedence will be as follows:
Property token configured in the extension card > Property token passed in Event Data

Should we change this so the event data value has precedence over the configured value? Seems like it's being used as an override, which in my mind means it should have higher priority. WDYT?

@sbenedicadb I thought about this. And this is how we support it with 2.x to encourage customers to use the Launch card for property token configuration. Changing this behavior now might lead to more confusion. Moreover, we verified that LBG is not using the Target Launch configuration for property token. So they can just update it remotely for any Target request that they want. In case they do not update it for a request, no token will be attached (assume default workspace).

Copy link
Copy Markdown
Member

@sbenedicadb sbenedicadb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good - very minor stuff in comments


/// Reads the Target `at_property` from the event data
var propertyToken: String {
return data?[TargetConstants.EventDataKeys.AT_PROPERTY] as? String ?? ""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a one-liner implementation for an extension variable can omit the return keyword

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, thanks for the reminder!

// Set parameters: getMboxParameters
let mboxParameters = getMboxParameters(mboxParameters: targetParameters?.parameters, lifecycleContextData: lifecycleContextData)
// Set parameters
let parameters = targetParameters?.parameters?.filter { $0.key != TargetConstants.EventDataKeys.AT_PROPERTY }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean 😄

@swarna04 swarna04 merged commit 495b1e9 into adobe:dev-3.3.0 Sep 8, 2022
swarna04 added a commit that referenced this pull request Oct 12, 2022
* Support remote updates to Target property token (#121)

* Support remote updates to Target property token

* Updated xcode to v13.0.0 in circle CI config file.

* Incorporated feedback.

* Added new raw Target APIs for non-unique batch mboxes support (#122)

* Support remote updates to Target property token

* Added New APIs for Target non-unique batch mboxes support

* Incorporated feedback

* Incorporated feedback

* Fixed the build issue

* More feedback updates.

* Clean up

* Target release prep + misc fixes (#123)

* Added new raw Target APIs for mbox content and notifications (#125)

* Support for new raw Target APIs for mbox content and notifications

* format updates

* Added more functional tests

* Rename sendRawNotification to sendRawNotifications

* Event name cleanup

* build fixes

* minor testapp update

* Added more functional tests

* minor doc cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants