The target-content-id needs to be populated to target the specific App Clip experiences, since an app can have multiple App Clips. Our backend sends push notifications targeting specific users. However, I can't find anything in the API to populate the target-content-id. I couldn't find a better thread to start this, but since this affects App Clips I though it would be ok here. Any insights on how this is being handled?
Hello this is supported both on the dashboard and via our public api via the target content id field.
target_content_identifier is the field you want to use
Here is an example message:
curl -k \
--include \
--request POST \
--header "Content-Type: application/json; charset=utf-8" \
--header "Authorization: Basic ZjM3NWRhZmYtODA1NC00OTYzLThiNmYtZGRmM2NiMWJlNjg1" \
--data-binary "{\"app_id\": \"9ddf83fd-6cf8-403d-98a1-bd5285b23d0e\",
\"contents\": {\"en\": \"English message\"},
\"headings\": {\"en\": \"English heading\"},
\"isIos\": true,
\"target_content_identifier\": \"https://www.onesignal.com/appClip/\",
\"included_segments\": [\"Subscribed Users\"]}" \
https://staging-01.onesignal.com/api/v1/notifications
Awesome that worked great! Thank you!!
Another quick question on the iOS side, I need to extract that target-content-id URL so I can deep link the user in the app from the notification tap. Otherwise, it will open the right App Clip, but it will not deep link from the home screen of the App Clip based on the URL, so I need to access it to route them properly. Is there an API on the iOS SDK side to access target-content-id field, even if through a dictionary?
@basememara You can try getting it by implementing the OSNotificationOpenedBlock and setting it via setNotificationOpenedHandler. In the OSNotificationOpenedResult access the OSNotification object's rawPayload dictionary and look for "target-content-id"