Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Crash on clearPushRegistrationId() #134

Open
@lucasrocali

Description

@lucasrocali

The method clearPushRegistrationId() is getting the following error:
RNMixpanel.clearPushRegistrationId got 2 arguments, expected 3
The reason may be because the native method expects the apiToken

@ReactMethod
    public void clearPushRegistrationId(final String apiToken, Promise promise) {
        final MixpanelAPI instance = getInstance(apiToken);
        synchronized(instance) {
            instance.getPeople().clearPushRegistrationId();
        }
        promise.resolve(null);
    }

But the index.js does not sends it

clearPushRegistrationId(): Promise<void> {
    if (!this.initialized) throw new Error(uninitializedError('clearPushRegistrationId'))

    if (!RNMixpanel.clearPushRegistrationId) throw new Error('No native implementation for setPusclearPushRegistrationIdhRegistrationId.  This is Android only.')
    return RNMixpanel.clearPushRegistrationId()
  }

The solution may be simple, just add the apiToken on the method, just like most of the other methods do
return RNMixpanel.clearPushRegistrationId(this.apiToken)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions