user2686299
user2686299

Reputation: 427

Parse, Push notifications. How to reset Installation data?

When I start my app on Android first time in Parse App creates an object with the name - Installation. It contains some info about the device.

But if I delete this info from Parse App and run an app on Android again - nothing has been created in Parse App, I mean Installation object.

How to fix it? I want to create Installation object in Parse App if it does not exists for the current device.

Upvotes: 1

Views: 391

Answers (1)

sozes
sozes

Reputation: 21

I ran into this same issue where I removed the installation on the Parse dashboard and any other use of the app it could not find the installation object and would not create. I created a new class that I called on create. You could do a save and if exception, then reset and then call getCurrentInstallation(). This was the only way it worked for me.

package com.parse;

public class Installation extends ParseInstallation {

public static void reset() {
    ParseCurrentInstallationController controller = ParseCorePlugins.getInstance().getCurrentInstallationController();
    controller.clearFromDisk();
    controller.clearFromMemory();
}

}

Upvotes: 2

Related Questions