Skip to content

Added push data key for APNS key thread-id #117

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

Merged
merged 5 commits into from
Jun 4, 2018

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Jun 3, 2018

No description provided.

flovilmart
flovilmart previously approved these changes Jun 3, 2018
@flovilmart
Copy link
Contributor

Thanks for the PR

@codecov
Copy link

codecov bot commented Jun 3, 2018

Codecov Report

Merging #117 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #117   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines         256    258    +2     
=====================================
+ Hits          256    258    +2
Impacted Files Coverage Δ
src/APNS.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 425d7d8...fec1644. Read the comment docs.

@flovilmart
Copy link
Contributor

Can you please add a test to ensure the notification get the proper setter called when the added key value pairs are passed part of the payload?

@mtrezza mtrezza changed the title Added push data keys for APNS keys thread-id, urlArgs. Added push data key for APNS key thread-id Jun 4, 2018
mtrezza added 2 commits June 4, 2018 02:41
…sh notifications to Safari which does not seem to be supported by parse server yet
@flovilmart
Copy link
Contributor

Awesome! Thanks!

@flovilmart flovilmart merged commit e7f9bc4 into parse-community:master Jun 4, 2018
@bmueller
Copy link

@mtrezza @flovilmart I'm trying to implement thread-id via Cloud Code, but haven't been able to get it to work. I've tried putting threadId in the alert and the data dictionary, and have also tried threadId and thread-id for the variable name. Any thoughts on what I could be doing wrong here?

Parse.Push.send({
    where: pushQuery, // Set our Installation query
    collapse_id: request.params.collapseId,
    threadId: request.params.threadId,
    data: {
      alert: {
        title: request.params.title,
        body: request.params.body,
        threadId: request.params.threadId,
      },
      sound: request.params.sound,
      category: request.params.category,
      threadId: request.params.threadId,
      userInfo: request.params.userInfo,
    }
  }

@mtrezza
Copy link
Member Author

mtrezza commented Mar 18, 2019

@bmueller

Parse.Push.send({
    where: pushQuery, // Set our Installation query
    collapse_id: request.params.collapseId,
    data: {
      alert: {
        title: request.params.title,
        body: request.params.body
      },
      sound: request.params.sound,
      category: request.params.category,
      threadId: request.params.threadId,
      userInfo: request.params.userInfo
    }
  }

This should work. If it doesn't, I suggest you start by checking the APN data received on the device.

@bmueller
Copy link

bmueller commented Mar 18, 2019

@mtrezza

Hmm, when I put the thread ID in the data dictionary, the payload sent by Parse has threadId in it (see below), but when I put a breakpoint on the UNNotification in willPresentNotification in the app, threadIdentifier is set to @"". Everything else sent in the payload (category, title, etc) is set correctly on the UNNotification.

"payload":"{\"alert\":{\"title\":\"Test\",\"body\":\"Testing 1 2 3.\"},\"sound\":\"default\",\"category\":\"custom\",\"threadId\":\"Testing This\",\"userInfo\":{\"dataPoint\":4}}"

@bmueller
Copy link

@mtrezza

Here's the userInfo dictionary on the notification as it comes in. Shouldn't the threadId appear inside the aps dictionary?

    aps =     {
        alert =         {
            body = "Testing 1 2 3.";
            title = Test;
        };
        category = custom;
        sound = default;
    };
    threadId = "test test";

@mtrezza mtrezza deleted the add-apn-keys branch November 21, 2021 15:47
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.

3 participants