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

Proxy device push token call manually #17

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Proxy device push token call manually #17

merged 2 commits into from
Jan 31, 2024

Conversation

ferologics
Copy link
Contributor

@ferologics ferologics commented Jan 29, 2024

In some cases the swizzling callback with device push token does not come through. For those instances we want to invoke the call manually. This PR adds a HyperTrack.swift file that exposes our SDK's API for manual calls, i.e. didRegisterForRemoteNotificationsWithDeviceToken, and generates the required AppDelegate code to call it. This functionality is enabled by setting the optional proxyDevicePushTokenCall property of the config plugin to true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

phew, yarn is going places 🤯

Copy link

@nazerhasanian nazerhasanian 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, thank you for doing this! Need to test with an expo prebuild. HAve to add

proxyDevicePushTokenCall: true

in the app.json correct?

@ferologics
Copy link
Contributor Author

ferologics commented Jan 29, 2024

yes, @nazerhasanian in app.json or app.config.js, for the hypertrack-sdk-expo plugin:

{
  "expo": {
    "plugins": [
      [
        "hypertrack-sdk-expo",
        {
          ... other props ...
          "proxyDevicePushTokenCall": true, // 👈 add this
        }
      ]
    ]
  }
}

@ferologics ferologics marked this pull request as ready for review January 31, 2024 20:26
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the interesting part is here

@ferologics ferologics merged commit 6fa2310 into main Jan 31, 2024
@ferologics ferologics deleted the device-push-token branch January 31, 2024 20:27
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