-
Notifications
You must be signed in to change notification settings - Fork 17
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
Adds method passes to retrieve any available passes #9
base: master
Are you sure you want to change the base?
Conversation
self.passLibrary = [[PKPassLibrary alloc] init]; | ||
NSArray *passes = [self.passLibrary passes]; | ||
|
||
NSDictionary *dict = [NSDictionary dictionaryWithObjects:passes forKeys:[passes valueForKey:@"serialNumber"]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel this is very readable
NSDictionary *dict = [NSDictionary dictionaryWithObjects:passes forKeys:[passes valueForKey:@"serialNumber"]]; | ||
NSArray*serials=[dict allKeys]; | ||
|
||
callback(@[[NSNull null], serials]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use the Node convention of passing null instead on an error in this project.
Either use a callback for a call that always succeeds or us a promise :)
_showAddPassControllerFromURL, | ||
_showAddPassControllerFromFile, | ||
_passes | ||
} from './platform-specific' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Respecting the print line 🕺
@@ -17,7 +22,7 @@ function canAddPasses(callback) { | |||
* @return Promise Passing a boolean | |||
*/ | |||
function showAddPassControllerFromURL(passURL) { | |||
return _showAddPassControllerFromURL(RNWalletModule, passURL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤨
I guess what I want to say is: Don't change someone's code style in a PR?
NSArray *passes = [self.passLibrary passes]; | ||
|
||
NSDictionary *dict = [NSDictionary dictionaryWithObjects:passes forKeys:[passes valueForKey:@"serialNumber"]]; | ||
NSArray*serials=[dict allKeys]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you're trying to reduce an array of passes to an array of serialnumbers?
Adds the ability to receive passes by calling
Wallet.passes(callback)
.