Skip to content

Android CloudMessaging: Cannot read property 'getToken' of undefined #325

Open
@studiobrain

Description

@studiobrain
constructor() {
    console.log('UserStore', firebase.cloudMessaging)
    firebase.cloudMessaging.getToken().then((token) => {
      console.log('device token', token)
      this.deviceToken = token
    })
  }

the log returns an object:

CloudMessaging {firestack: Firestack, eventHandlers: Object, options: Object, requestedPermissions: Object}

however getToken() returns the error:

Possible Unhandled Promise Rejection (id: 0):
Cannot read property 'getToken' of undefined
TypeError: Cannot read property 'getToken' of undefined

Have the callbacks been resolved via the @ReactMethod, so that the js can participate in cloud messaging?

via:
"react-native-firestack": "^2.3.9",
"react-native": "0.42.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions