I was still thinking about those 2 last points (last night while baking pancakes) it seems that we can’t make it optimal. So I would propose to do something like this:
push.register(function(event) {
alert(event.alert);
},
function(error) {
throw error;
}, {
pushServerURL: "<pushServerURL e.g http(s)//host:port/context >",
alias: "<alias e.g. a username or an email address optional>",
android: {
senderID: "<senderID e.g Google Project ID only for android>",
variantID: "<variantID e.g. 1234456-234320>",
variantSecret: "<variantSecret e.g. 1234456-234320>",
},
ios: {
variantID: "<variantID e.g. 1234456-234320>",
variantSecret: "<variantSecret e.g. 1234456-234320>",
}
});
Instead of leaving it to the user to find some sort of way to deal with the 2 variants we supply him with a way to configure both. On iOS the plugin will use the iOS part of the config and on android the android part plus a generic part.
And if you cordova app is only for one device maybe we could support this as well:
push.register(function(event) {
alert(event.alert);
},
function(error) {
throw error;
}, {
pushServerURL: "<pushServerURL e.g http(s)//host:port/context >",
alias: "<alias e.g. a username or an email address optional>",
senderID: "<senderID e.g Google Project ID only for android>",
variantID: "<variantID e.g. 1234456-234320>",
variantSecret: "<variantSecret e.g. 1234456-234320>"
});
This will just take the variantID and secret that are on the ‘root’ level regardless of the device type, so it would only work on one. But maybe this will confuse people again.
WDYT,
Erik Jan