Ios 使用parse.com购买附加应用程序
我正在使用parse.com作为后端开发cards应用程序,该应用程序非常适合免费卡,我可以显示所有卡并单击任何卡以获得完整视图,这样客户就可以编写文本并定制并发送给朋友 我的问题是如何将高级卡添加到应用程序中,以便客户需要先购买,然后才能使用它并发送给朋友。是否可以在同一视图中同时显示免费卡和高级卡,并在高级卡上添加带有价格的标签 我正在使用Carousol显示所有卡,这是显示卡的代码Ios 使用parse.com购买附加应用程序,ios,in-app-purchase,parse-platform,icarousel,Ios,In App Purchase,Parse Platform,Icarousel,我正在使用parse.com作为后端开发cards应用程序,该应用程序非常适合免费卡,我可以显示所有卡并单击任何卡以获得完整视图,这样客户就可以编写文本并定制并发送给朋友 我的问题是如何将高级卡添加到应用程序中,以便客户需要先购买,然后才能使用它并发送给朋友。是否可以在同一视图中同时显示免费卡和高级卡,并在高级卡上添加带有价格的标签 我正在使用Carousol显示所有卡,这是显示卡的代码 - (UIView *)carousel:(iCarousel *)carousel viewForItem
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
self.cardFileArray = [[NSMutableArray alloc] init];
//create new view if no view is available for recycling
view = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 250.0f, 350.0f)] autorelease];
PFQuery *query = [PFQuery queryWithClassName:WALL_OBJECT3];
query.cachePolicy = kPFCachePolicyCacheOnly;
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
cardFileArray = [[NSMutableArray alloc] initWithArray:objects];
PFObject *object = [cardFileArray objectAtIndex:index];
PFFile *file = [object objectForKey:KEY_IMAGE4];
[file getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
((UIImageView *)view).image = [UIImage imageWithData:data];
}
}];
}
}];
}
这是客户选择要预览和编辑的卡时的代码
-(void)carousel:(iCarousel *)carousel didSelectItemAtIndex:(NSInteger)index{
PFObject *object = [cardFileArray objectAtIndex:index];
PFFile *file = [object objectForKey:KEY_IMAGE5];
NSString *tmpObject = [NSString stringWithFormat:@"%@",object.objectId];
[HUD showUIBlockingIndicatorWithText:@"Loading Card"];
[file getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
CardDetailsViewController*ptvc = [self.storyboard instantiateViewControllerWithIdentifier:@"cardsDetail"];
[self.navigationController pushViewController:ptvc animated:YES];
ptvc.ImageForDetail = [UIImage imageWithData:data];
ptvc.imageString = tmpObject;
ptvc.title = title2;
[HUD hideUIBlockingIndicator];
}
}];
}
你能帮助我如何将应用内购买添加到我的应用中吗
谢谢是的,这是可能的。您需要在从查询中获取的数据的代码中保存卡的类型(免费/高级)或其价格。然后,根据图像的状态,可以在-viewForItemAtIndex方法中对图像应用标签
至于实现应用内购买,您应该仔细阅读。谢谢,我应该在解析查询中添加价格键,如果价格键>0,则添加条件,然后进行应用内购买并应用它。是这样吗?