-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
Android subscription upgrade/downgrade #188
Conversation
@vshab Won't this be better to create another method for this one? Because, we need some migration guide which can break in some developer's env. |
@dooboolab this change shouldn't change anything for exciting apps like in 99% I would say. The oldSku parameter is optional, so existing code should just work. I think that something is possible if somebody for some reason passing extra parameter in buySubscription method which doesn't make any sense now :) |
@vshab Thank you for your confirm. I am confused. I thought methods with different number of parameters are different. Below are two different methods in js isn't it? Correct me if I am wrong.
Also, to be optional in ts, you should put
to
|
Not exactly. When calling you can pass as many arguments to function as you want, the difference is how to access them inside of a function. Lest look at two functions for example: function foo(a) {
console.log(a, arguments[1]);
}
function bar(b, c) {
console.log(b);
} We can call first one with two arguments: foo(1, 2); and get And call second one with one argument: bar(3); and get By default function arguments are set to
So basically in JS function can accept any number of arguments and naming them in definition only helps accessing. If there are less arguments in call than in definition then unspecified arguments will be
You are right here! I'm not very good in TypeScript :( |
@dooboolab i updated TypeScript definition. |
@vshab Thank you for your specific explanation. I was confused with the |
@dooboolab yep, I've tested the code. |
Ok. I will merge this and publish to newer version of npm which will be |
@dooboolab 🎉 I hope we won't break anything :) |
@vshab Thanks for your new feature. Also, there was a break in this |
@dooboolab oh.. that's unfortunate. But good job fixing it! :) |
Hello!
Add optional
oldSku
parameter forbuySubscription
on Android to support subscription upgrade/downgrade.Fix #185