Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

'senderID’ does not exist in type ‘AndroidPushOptions’ #1998

Closed
Boredude opened this issue Oct 6, 2017 · 8 comments
Closed

'senderID’ does not exist in type ‘AndroidPushOptions’ #1998

Boredude opened this issue Oct 6, 2017 · 8 comments
Labels

Comments

@Boredude
Copy link

Boredude commented Oct 6, 2017

I'm trying to build my project for Ios and I get the following error

Type '{ android: { senderID: string; icon: string; iconColor: string; sound: true; }; ios: { alert: "tr...' is not assignable to type 'PushOptions'. Types of property 'android' are incompatible. Type '{ senderID: string; icon: string; iconColor: string; sound: true; }' is not assignable to type 'AndroidPushOptions'. Object literal may only specify known properties, and 'senderID' does not exist in type 'AndroidPushOptions'.

The exact same code gives no error when I use it on my windows machine and run it on android device.

Please help

Expected Behaviour

Build transpiles

Actual Behaviour

Error recieved on IOS platform

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

android ~6.2.2
blackberry10 ~3.8.0 (deprecated)
browser ~4.1.0
ios ~4.4.0
osx ~4.0.1
webos ~3.7.0

cocoaPods version is 1.3.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Cordova CLI version and cordova platform version

cordova --version           7.0.1
cordova platform version ios  4.4.0

Plugin version

cordova plugin version | grep phonegap-plugin-push   2.0.0

Sample Push Data Payload

Sample Code that illustrates the problem

Logs taken while reproducing problem

@macdonst macdonst added the ionic label Oct 7, 2017
@macdonst
Copy link
Member

macdonst commented Oct 7, 2017

@Boredude you'll have to open an issue with Ionic as that is an error coming from their wrapper.

@elbakly
Copy link

elbakly commented Oct 15, 2017

just remove the senderID from the the android json like the link below and it will work fine. you already have that in the config xml

const options: PushOptions = {
   android: {},
   ios: {
       alert: 'true',
       badge: true,
       sound: 'false'
   },
   windows: {},
   browser: {
       pushServiceURL: 'http://push.api.phonegap.com/v1/push'
   }
};
 <plugin name="phonegap-plugin-push" spec="^1.10.5">
        <variable name="SENDER_ID" value="911xxxxxxxx" />
    </plugin>

https://ionicframework.com/docs/native/push/

@BajajSaajan
Copy link

The same process i am doing that but i am getting error while running on android device. that's No Value For senderID. please help me.

@mattheuspirovani
Copy link

mattheuspirovani commented Nov 17, 2017

@BajajSaajan and @Boredude change your options to a any object instead of a PushOptions like the follow snippet:

const options: any = {
  android: {
    senderID: "",
    sound: false,
    icon: 'notification',
    clearBadge: true
  },
  ios: {
    alert: 'true',
    badge: true,
    sound: 'false',
    clearBadge: true
  },
  windows: {}
};

It's a trick but will work...

@BajajSaajan
Copy link

@mattheuspirovani Thank you so much :)

@eai301
Copy link

eai301 commented Nov 25, 2017

@mattheuspirovani it do the trick

senderID already have that in the config xml

@guazarito
Copy link

@mattheuspirovani

Thankkkksssssss a lot

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

7 participants