Skip to content

Clearing a push on the client side and persisting badge = 0 in mlab (and Push by installation id) #1832

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

Closed
2 tasks done
goggelj opened this issue May 18, 2016 · 1 comment
Closed
2 tasks done

Comments

@goggelj
Copy link

goggelj commented May 18, 2016

We are in the process of migrating our Parse server from Parse.com to Heroku. Everything looks ok except that when testing Push Notifications & clearing of Push Notifications we noticed the following:

Issue 1:
Some users that downloaded (via test flight) a version of the app that points to Heroku, cannot seem to clear the badge in the database until they delete the app and reinstall it (as oppose to just update the app).

I am using this code to reset the badge:

let installation = PFInstallation.currentInstallation()
installation.badge = 0
installation.saveEventually()

Is this just our problem? Is there a need as part of the migration to ask users to delete the app from their device and reinstall it? Any other ideas?

Issue 2 (question?):
It seems that to send a push to devices based on installation ids using python REST API now requires the following REST API code:

MyParse.connection.connect()
MyParse.connection.request('POST', '/parse/push', json.dumps({
      "where": {"installationId": {"$in": ['<installation id 1>', '<installation id 2>']}},
                "data": data
            }), MyParse.parse_dict)

response = json.loads(MyParse.connection.getresponse().read())

Is this an actual change in protocol? We used to specify installation in 'data' using:

data = {
  "alert": alert_msg,
  "badge": "Increment",
  "installation_id": installation_id
}

But now, this sends a push to everyone...

Also, sending a push from Parse dashboard (Parse.com) using an installation id ended up in sending the push to everyone!

Check out #1271 for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!

Many members of the community use Stack Overflow and Server Fault to ask questions. Read through the existing questions or ask your own!

For database migration help, please file a bug report at https://parse.com/help#report

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

  • Server: parse-server version, operating system, hardware, local or remote?
  • Database: version, storage engine, hardware, local or remote?

On Heroku:
2xserver: parse server example (changed to config to parse-server ~2.2.4). One server communicates with my python server (it generates a lot of data so a dedicated line is preferred) and one as the app backend.
database: mlab on aws us east

iOS App:
We only have an iphone version of the app. The app has been configured using these guidelines:

let configuration = ParseClientConfiguration {
            $0.applicationId = valueForAPIKey(keyname: "PARSE_APPLICATION_ID")
            $0.clientKey = valueForAPIKey(keyname: "PARSE_CLIENT_KEY")
            $0.server = valueForAPIKey(keyname: "NEW_PARSE_SERVER_URL")
        }
Parse.initializeWithConfiguration(configuration)

Steps to reproduce

  • What was the expected result? What is the actual outcome?
    The result is that everyone got a push.

Logs/Trace

@goggelj goggelj changed the title Push by installation id + clearing a push on the client side and persisting badge = 0 in mlab Clearing a push on the client side and persisting badge = 0 in mlab (and Push by installation id + ) May 18, 2016
@goggelj goggelj changed the title Clearing a push on the client side and persisting badge = 0 in mlab (and Push by installation id + ) Clearing a push on the client side and persisting badge = 0 in mlab (and Push by installation id) May 18, 2016
@hramos
Copy link
Contributor

hramos commented Jun 22, 2016

Closing this as it is not clear that there is an issue specific to Parse Server.

For code-level and/or implementation-related questions or technical support, please refer to Stack Overflow.

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

2 participants