How to access passages from a savings book in my application?

I am creating an application in which I add and display passages from an iOS6 bookbook application to my application. But when I run the application on the simulator, it shows the added gaps, but when I run them on the device, it shows that my help is empty.

I followed the iOS6 tutorial integrating your account for your apps to create, add and display passes.

to access the passages I used the following code -

NSArray * passArray = [_passLib passes]; NSLog(@"number of passes in library are: %d",[passArray count]); //if more tha one pass in library, just use the first one. if ([passArray count] > 0) { for (int i = 0; i<[passArray count]; i++) { PKPass *onePass = [passArray objectAtIndex:i]; //access general fieldnames NSLog(@"%@",[onePass localizedName]); NSLog(@"%@",[onePass organizationName]); //access a specific field name NSLog(@"%@",[onePass localizedValueForFieldKey:@"rewards"]); } } 

Do I need to make any changes if we run the application on the device to support integration with the account?

+6
source share
2 answers

Create an AppId that looks like passTypeIdentifier. For example, if your passTypeIdentifier is pass.abc.xyz, then your AppId should be com.abc.xyz. If creating an initialization profile uses this appId and use this provisioning profile for your application. Then only you can distinguish between the gaps available in your savings book.

+6
source

When you run the application on the simulator, it basically ignores the passTypeIdentifier in which the passages were created in the Passbook application. Therefore, if the Passbook application on the Simulator has at least one pass, it will be displayed in your application.

On the other hand, on a device, a PKPassLibrary is initialized only with passages that were created with passTypeIdentifier equal to those that you have in the provisioning profile and are configured in the application rights. Strictly speaking - only with passages that you own.

Keep in mind that the identifier of the application with which you sign the code must be Enable for passages on the Provisioning portal.

+3
source

All Articles