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

content-available: 1 is not attached to a transactional message #113

Open
miguelespinoza opened this issue Feb 21, 2024 · 3 comments
Open

Comments

@miguelespinoza
Copy link

miguelespinoza commented Feb 21, 2024

I'm working with an Expo mobile project, in which I'm trying to listen to background notifications.
I managed to get it working through the customer.io transactional dashboard, using this custom payload:

{
  "aps": {
    "alert": {
      "title": "Customer.io push from dashboard",
      "body": "with content-available: 1"
    },
    "mutable-content": 1,
    "content-available": 1,
    "sound": "default"
  }
}

When I try with the ruby gem using custom_payload on the request body, I get none of the background listeners to execute, but I get the push notification. I suspect "content-available": 1 is not getting carried over to the transactional message payload

request = Customerio::SendPushRequest.new(
   ....
   custom_payload: {
      ios: {
          aps: {
             "content-available": 1
          },
      },
   },
)

Any pointers would be greatly appreciated!

@miguelespinoza
Copy link
Author

miguelespinoza commented Feb 26, 2024

I'll also add, this affects our ability to set badge count remotely. This does not work, I would expect this to relay directly to the device

request = Customerio::SendPushRequest.new(
   custom_payload: {
      ios: {
          aps: {
             "badge": 2,
          },
      },
   },
)

@miguelespinoza
Copy link
Author

here's something interesting. I started to work directly with the REST API and found out this payload works, but link (for deep linking) no longer works.

{
  "transactional_message_id": "30",
  "link": "https://example.com/posts/:post_id",
  "identifiers": {
    "id": "user_id"
  },
  "custom_payload": {
    "ios": {
      "aps": {
        "alert": "Custom push title",
        "badge": 24,
        "content-available": 1
      }
    }
  }
}

The moment I remove custom_payload, I'm able to deep link into the post. I expect for the link property to work in conjunction with the aps properties. I'd imagine this would require a REST API adjustment. Anyone I can speak to about this?

@miguelespinoza
Copy link
Author

update: figured out that link needs to be in CIO.push

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

No branches or pull requests

1 participant