Skip to content
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

Push notifications proposal #206

Open
maxgurewitz opened this issue May 22, 2023 · 3 comments
Open

Push notifications proposal #206

maxgurewitz opened this issue May 22, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@maxgurewitz
Copy link
Member

maxgurewitz commented May 22, 2023

This issue will contain the proposal to add IOS push, and Android push channels.

Backend

New required models / concepts:

  • New "Channel" entries, with device id's as the relevant identifier rather than email address.
  • For mobile push, we need a new convention for recording and calculating device specific subscription state.
    • Standard subscriptions are device independent and configured within the upstream application.
    • Device specific subscriptions, which are configured within the end user's device settings.
  • Some standard set of user properties to be aggregated in clickhouse, including device subscription status (better name pending), and device token.
  • A new "Application" model. This model will have an assigned auth token secret, which will be used to retrieve user's device tokens.
  • Channel specific analytics.

We will also need to amend our user journey temporal worker to support additional message types.

Frontend

New requirements:

  • A way to select different messaging channels from the journey builder message node.
  • A way to create channel specific templates from the UI.
  • A way to restrict the available the available templates in the message node based on the selected message type.
  • A way add the relevant mobile auth token in the application settings.
@maxgurewitz maxgurewitz added the enhancement New feature or request label May 22, 2023
@danish1112
Copy link

danish1112 commented Apr 23, 2024

Implementation and Architecture Proposal for React Native SDK for Push Notifications

  1. Device Token Generation:

    • Implement logic to generate a unique device token using Firebase FCM upon app launch.
    • Store the device token locally on the user's device for future use or we can send directly from track event to backend.
  2. Identity Event Trigger:

    • Enhance the SDK to trigger an identity event upon successful token generation.
    • Associate the device token with the user ID for backend tracking purposes.
  3. Event Tracking:

    • SDK to track the following events related to push notifications:
      • Push Received: Track when a push notification is received by the device.
      • Push Viewed: Track when a user views a received push notification.
      • Push Clicked: Track when a user clicks on a received push notification.
    • Implement event tracking mechanisms within the SDK to capture and record these events.
    • Associate these events along with the user_id and journey_id for reporting purposes.

By following steps, we can enhance our SDK to effectively track push notification events and provide insights for analytics and reporting purposes. It's crucial to note that for push notifications, the entire analytics process will rely on sdk events. @maxgurewitz please add anything you'd like, and let me know if you're ready to proceed with the implementation.

@danish1112
Copy link

Backend Higher level flow/Implementation Proposal:

  1. Receiving Device Info:

    • When we get the token and user ID from the SDK, we'll start by creating a journey.
  2. Fetching Message Template:

    • Next, we'll grab the token and message template stored in our db.
  3. Personalizing Message:

    • Then, we'll make the message personal by adding details that match the user's profile.
  4. Creating Payload:

    • After that, we'll put together all the info needed for the push notification.
  5. Using Providers:

    • We'll use two providers, FCM for Android and APNS for iOS, to send the notification.
  6. Sending to Devices:

    • The notification will then be sent to the user's device based on the platform they're using.
  7. Tracking SDK Events:

    • We'll monitor the events triggered by the SDK, such as when a push notification is received, viewed, or clicked. This data will be crucial for reporting and understanding user engagement.

In this plan, we'll update Temporal to handle push notifications by adding support for the "PUSH" message type. We'll fetch user details, message templates, and provider info to send push notifications. Plus, we'll handle campaign events from the SDK for reporting. @maxgurewitz Anything else you'd like to include in backend before we move forward with the implementation?

@maxgurewitz
Copy link
Member Author

@danish1112 a few things!

  1. We have a work in progress in progress of native mobile push. @Kacppian worked on it.
  2. You can currently use our webhook channel to implement native mobile push, using a deviceToken user property as an identifier, and sending a request to fcm. We plan to release an instructional video on how to do this soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants