-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adobe Campaign Classic clean up #630
Adobe Campaign Classic clean up #630
Conversation
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-event-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-event-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-event-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-event-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-event-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Outdated
Show resolved
Hide resolved
@calebk1 we provided some feedback on this PR, let us know if you are still working on it or when you need the final review. |
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-event-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Outdated
Show resolved
Hide resolved
@@ -240,19 +249,27 @@ public void onResume() { | |||
{% endtab %} | |||
|
|||
{% tab title="iOS" %} | |||
### trackNotificationClick | |||
{% hint style="info"} | |||
You can pass the `launchOptions` that was received before opening the application or `userInfo`, which contains the received push payload in `trackInfo`. If `trackInfo` is null or does not contain the necessary tracking identifiers, `broadlogId` (`_mId`) and `deliveryId` (`_dId`), a track request is **not** sent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... launchOptions
dictionary that was received upon opening the application...
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-event-reference.md
Show resolved
Hide resolved
|
||
The `registerDevice` API registers a device with your Campaign Classic registration server. It takes the APNS token as a parameter with a user key that identifies a user, such as an email address or a login name. You can also provide a map of the custom key-value pairs that you want to associate with the registration. A boolean value is returned in the callback, which signals whether the registration was successful. | ||
{% endhint %} | ||
|
||
### Swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we done this change in other extension docs too? I find this format a little odd
Swift -> Example
Objective-C - > Syntax, Example
(1) We should include syntax with Swift too; or
(2) Keep syntax first (Objective-C only in case of 2.x) and then include Swift/ Objective-C examples. Refer to - https://aep-sdks.gitbook.io/docs/using-mobile-extensions/adobe-target/target-api-reference#displayedlocations
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I should also include the syntax for it - that being said, I didn't have the syntax, which is why I wasn't sure what to add.
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Outdated
Show resolved
Hide resolved
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Show resolved
Hide resolved
**Syntax** | ||
|
||
```swift | ||
func registerDevice(deviceToken: Token, userKey: String, additionalParams: @escaping (Bool) -> Void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct syntax here is
func registerDevice(_ token: Data, userKey: String?, additionalParams: [String: Any]?, callback: ((Bool) -> Void)?)
**Syntax** | ||
|
||
```swift | ||
func trackNotificationReceive(trackInfo: [String: String]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct syntax here is
func trackNotificationReceive(_ trackInfo: [String: String])
**Syntax** | ||
|
||
```swift | ||
func trackNotificationClick(trackInfo: [String: String]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct syntax here is
func trackNotificationClick(_ trackInfo: [String: String])
using-mobile-extensions/adobe-campaignclassic/adobe-campaignclassic-api-reference.md
Outdated
Show resolved
Hide resolved
|
||
#### Syntax | ||
```swift | ||
ACPCampaignClassic.trackNotificationClick(trackInfo[String:String]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
guard let userInfo = response.notification.request.content.userInfo as? [String: String] else {
return
}
ACPCampaignClassic.trackNotificationClick(userInfo)
completionHandler()
}
func registerDevice(deviceToken: Token, userKey: String, additionalParams: @escaping (Bool) -> Void) | ||
``` | ||
|
||
**Example** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let params: [String: Any] = [
"name": "John",
"serial": 12345,
"premium": true
]
ACPCampaignClassic.registerDevice(deviceToken, userKey: "johndoe@gmail.com", additionalParams: params) { result in
print("Registration status: \(result)")
}
}
@calebk1 thank you for all the updates so far, can you please review the final round of feedback from Swarna? |
Oooh somehow I didn't notice the last set of comments - I should be able to get to this some time tomorrow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@calebk1 looks good with minor suggestions, feel free to merge once resolved.
"serial": 12345, | ||
"premium": true | ||
] | ||
ACPCampaignClassic.registerDevice(deviceToken, userKey: "johndoe@gmail.com", additionalParams: params) { result in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we update this to john@example.com and any other occurrences?
"deviceManufacturer": "unknown", | ||
"deviceUuid": "00000000-3398-7b70-0000-000033987b70" | ||
}, | ||
"userKey": "john.doe@adobe.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
ACPCampaignClassic.trackNotificationClick(userInfo) | ||
completionHandler() | ||
} | ||
``` | ||
|
||
### Objective-C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the format for the obj-c example below is a little off L330-331, can we fix that too?
[ACPCampaignClassic trackNotificationClick:response.notification.request.content.userInfo];
completionHandler();
No description provided.