Skip to content

Conversation

@adambutler
Copy link

Adds the ability to receive passes by calling Wallet.passes(callback).

self.passLibrary = [[PKPassLibrary alloc] init];
NSArray *passes = [self.passLibrary passes];

NSDictionary *dict = [NSDictionary dictionaryWithObjects:passes forKeys:[passes valueForKey:@"serialNumber"]];
Copy link
Owner

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]);
Copy link
Owner

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'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Respecting the print line 🕺

* @return Promise Passing a boolean
*/
function showAddPassControllerFromURL(passURL) {
return _showAddPassControllerFromURL(RNWalletModule, passURL);
Copy link
Owner

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];
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants