-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
For some time now some customers have complained that they do not receive push notifications correctly, we carried out the test here office, on our devices everything worked perfectly.
With the increase in complaints, we investigated more deeply, and through the parse-dashboard we identified that periodically, the installations were simply removed from the database, when opening the app again, the installation was created again for the device.
This ends up being extremely bad, as only users who opened the app in the last 2 or 3 days receive notifications, since the other installations have disappeared from the database.
I've read and researched a lot on the subject, here is a discussion that apparently talks about the same problem.
First I updated the parse-server to the latest version @4.3.0
It didn't work, so I decided to disable the feature to perform a test, I set PARSE_SERVER_CLEANUP_INVALID_INSTALLATIONS = 0
My server installation runs on Ubuntu 16.02, so I did it as follows:
export PARSE_SERVER_CLEANUP_INVALID_INSTALLATIONS=0
It also did not solve the problem, the installations continued to be removed ...
I went straight to the code and commented everything related to the devicesToRemove
variable in the StatusHandler.js class
It didn't solve either ...
I really don't know what else to do to solve the case ... I believe the problem is related to some routine that the parse-server performs, but I haven't figured out how to block it.
Has anyone else observed this behavior?
Any idea how to solve?
The application has about 90% of installations for Android, the code I use to register with the client is as follows:
FirebaseInstanceId.getInstance (). GetInstanceId (). AddOnSuccessListener (new OnSuccessListener <InstanceIdResult> () {
@Override
public void onSuccess (InstanceIdResult instanceIdResult) {
String token = instanceIdResult.getToken ();
ParseInstallation.getCurrentInstallation (). SetDeviceToken (token);
ParseInstallation.getCurrentInstallation (). SaveInBackground ();
}
});
On the server side, I start it as follows:
var api = new ParseServer ({
databaseURI: json.apps [i] .databaseURL,
appId: json.apps [i] .appId,
masterKey: json.apps [i] .masterKey, // Add your master key here. Keep it secret!
clientKey: json.apps [i] .clientKey,
serverURL: json.apps [i] .serverURL,
verbose: true,
push: {
android: {
apiKey: json.apps [i] .gcmApiKey
},
ios:
[{
pfx: json.apps [i] .pathCerDeviOS, // P12 file only
bundleId: json.apps [i] .bundleID, // change to match bundleId
production: false // dev certificate
},
{
pfx: json.apps [i] .pathCerReleaseiOS, // P12 file only
bundleId: json.apps [i] .bundleID, // change to match bundleId
production: true // release certificate
}]
}
});
app.use (mountPath, api);