PushNotificationDemo for Android fails to build

The token is refreshed in the following situations (see FirebaseInstanceIdService):

* App deletes Instance ID
* App is restored on a new device
* User uninstalls/reinstall the app
* User clears app data

it is odd that it only started crashing later, the crash would suggest that there is something wrong with the passed token. You get the crash after clean install because that’s when the token gets refreshed and the crashing line gets triggered. On successive start of the app you will not get the notification. Do you test it on a real device? What Android version is it? Please try the following fix and let me know if it works for you (uninstall and reinstall the app, and make sure that this line is definitely called after changing the code):

static void JNICALL tokenRefreshed (JNIEnv*, jobject, void* token)
{
    if (auto* instance = PushNotifications::getInstanceWithoutCreating())
        instance->pimpl->notifyListenersTokenRefreshed (juceString (static_cast<jstring> (token)));
}