Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
7 participants
@Boredude
Copy link

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

This comment has been minimized.

Copy link
Member

commented Oct 7, 2017

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

@elbakly

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Nov 13, 2017

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Nov 17, 2017

@mattheuspirovani Thank you so much :)

@eai301

This comment has been minimized.

Copy link

commented Nov 25, 2017

@mattheuspirovani it do the trick

senderID already have that in the config xml

@guazarito

This comment has been minimized.

Copy link

commented Mar 22, 2018

@mattheuspirovani

Thankkkksssssss a lot

@lock

This comment has been minimized.

Copy link

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.
You can’t perform that action at this time.