-
Notifications
You must be signed in to change notification settings - Fork 194
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
How do extensions work? #339
Comments
Good question, are you trying to use our SDK for both app and extension? |
@haoliu-amp yes, we use a notification content extension (which has interactions) as well as a share extension (which has interactions) and we'd like to track them the same way we track those views in our core app |
For our Realm data store (the data caching layer of our app) we use an app groups data directory so that when tagging users in the share extension the local cache of contacts can be searched and for our session key we store it within the App Group's UserDefaults. I would presume a similar pattern is needed for Amplitude assuming the identify data is stored in some sore of local file/info.plist. We'd need to specify which storage location to use such that it will be shared across Extensions. |
In our initial testing, we are not seeing any events from the Extensions. Is there something we are doing incorrectly @haoliu-amp ? |
@IsaiahJTurner We will take a look. @jooohhn will be helping you soon. |
@IsaiahJTurner thanks for your patience, I'm looking to get an answer to you by tomorrow |
@IsaiahJTurner Could you clarify how you're setting up Amplitude in your extensions? Amplitude's dev docs mention some differences when using Amplitude in extensions. Events might not be uploaded if |
I'm also running into issues when trying to use Amplitude with a notification service extension. It seems that the extension is killed right after processing notifications, so Amplitude is not able to perform the upload request. Even manually forcing the events to be uploaded using Would it be possible to add a completion handler or an event when uploading has finished, allowing to wait for that event before completing the processing of the notification in the extension? |
What we've observed that events from notification extensions are reported the next time service was triggered. My only concern is: will they ever be reported without sending another notification (let's assume we send one and only notification, service reports to Amplitude event "Notification received", but it didn't manage to upload that to Amplitude, we never ever send one more notification, so notification service won't be triggered again, will such event get a chance to be uploaded?). |
Summary
I see platformDataDirectory resolves to the library directory however this is not shared between extensions/the core app. Is it possible to specify an app groups path for the data directory? Otherwise, how do I ensure events sync between the main app and the extension. Will events from the extension when network was unavailable still be uploaded by the main app?
The text was updated successfully, but these errors were encountered: