heloisasim heloisasim - 2 months ago 13
Android Question

Push Notification: Update app with new Parse App

I need to release a new version of my app changing the Parse App. If I just install the app all new users appear in this new Parse App. But if update the app with this new version (with different parse app - applicationId and clientKey) the users did not appear in this new Parse App.

Here is the code where I send the new installation to parse:

Parse.initialize(AppgradeApplication.getContext(),getString(R.string.parse_application_id), getString(R.string.parse_client_key));
ParseInstallation currentInstallation = ParseInstallation.getCurrentInstallation();

What I need to do to change the Parse App?


What I ended up doing: clear parse installation from disk and memory. To do that, I needed to access protected methods from parse. So, I created a class with the path com.parse called ParseClearUtility and then I was able to access protected method from parse. See code below:

package com.parse;

public class ParseClearUtility {

    public static void clear() {


This code clear parse installation EVERY TIME a user opens the app. So, when initializing parse I check the version of the app:

Parse.initialize(context, BuildConfig.PARSE_APP_ID, BuildConfig.PARSE_CLIENT_KEY);

ParseInstallation currentInstallation = ParseInstallation.getCurrentInstallation();
List<String> channels = currentInstallation.getList(CHANNELS);
if(!currentInstallation.getString(COLUMN_APP_VERSION).equals(BuildConfig.VERSION_NAME)) {