基本上,我尝试在测试应用程序中设置应用程序购买,然后再将其应用到我公司正在开发的应用程序中.我已经阅读了商店套件pdf和其他片段大约1000次,但产品仍然是空的.这正是我到目前为止所做的:
设置测试应用程序和In App Purchase测试项目
我在iPhone开发人员中心的公司开发人员门户上为"Test App One"创建了一个新的应用程序ID.我确保前缀是com.mycompany.testappone确保可以配置应用内购买.保持应用ID部分,我通过勾选"启用应用内购买"选项配置应用购买.
我在iTunes Connect中创建了"Test App One",并完成了常规程序,但选择了"稍后上传二进制文件"并且没有提交审核,因为该应用程序什么都不做.当然,我们不必提交应用程序来审查这个工作?!然后,我点击管理应用内购买并创建一个新产品ID为"test1"并批准它以便清除销售.
代码
我在XCode中设置了一个新项目TestAppOne,这里是我现在使用的唯一两个类:
TestAppOneAppDelegate.h:
#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>
@interface TestAppOneAppDelegate : NSObject <UIApplicationDelegate, SKRequestDelegate, SKProductsRequestDelegate> {
UIWindow *window;
}
Run Code Online (Sandbox Code Playgroud)
TestAppOneDelegate.m:
#import "TestAppOneAppDelegate.h"
static NSString *kMyFeatureIdentifier1 = @"com.mycompany.testappone.test1";
@implementation TestAppOneAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
if([SKPaymentQueue canMakePayments]) {
NSLog(@"IN-APP:can make payments");
}
else {
NSLog(@"IN-APP:can't make payments");
}
[self requestProductData];
[window makeKeyAndVisible];
}
- (void)requestProductData {
NSLog(@"IN-APP:requestProductData");
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject:kMyFeatureIdentifier1]];
request.delegate …Run Code Online (Sandbox Code Playgroud) 我正在以水平滚动视图的形式在视图的底部(想想新闻频道的标题标题栏)显示一个自动收报机.当我将repeatCount设置为无限时,它可以正常工作,但我想在动画启动和停止时能够做一些其他功能.但是,在网上阅读了文档和很多例子后,我无法得到setAnimationWillStartSelector/setAnimationDidStopSelector来响应.
这是我的代码:
- (void)animateView {
[UIScrollView setAnimationDelegate:self];
[UIScrollView setAnimationWillStartSelector:@selector(animationStart:context:)];
[UIScrollView setAnimationDidStopSelector:@selector(animationStop:finished:context:)];
[UIScrollView beginAnimations:@"pan" context:nil];
[UIScrollView setAnimationDuration:10.0f];
[UIView setAnimationRepeatCount:1];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIScrollView setAnimationCurve:UIViewAnimationCurveLinear];
tickerScrollView.contentOffset = CGPointMake(textLabelRect.size.width,0);
[UIScrollView commitAnimations];
}
- (void)animationStart:(NSString *)animationID context:(void *)context {
NSLog(@"animationWillStart");
}
- (void)animationStop:(NSString *)animationID finished:(BOOL)finished context:(void *)context {
NSLog(@"animationDidStop");
[self animateView];
}
Run Code Online (Sandbox Code Playgroud)
目前,此代码位于我的UIViewController子类中.但是,我也尝试将它全部放在我的app委托中,同时也明显改变了setAnimationDelegate.我尝试过使用各种animationDurations,repeatCounts等,但仍然没有运气.
非常感谢任何帮助.谢谢
我们的应用程序有一个锁定产品列表,这些产品共享相同的耗材产品ID(即许多产品的一个耗材产品ID).我们的服务器向我提供了产品列表以及与之关联的产品ID:
item name ="itemA"iphoneProductId ="consumable.test.1"
item name ="itemB"iphoneProductId ="consumable.test.1"
item name ="itemC"iphoneProductId ="consumable.test.1"
我们之所以选择耗材是因为我们的产品是动态创建的,需要立即供用户使用(请不要回复,建议我们使用非耗材,还有很多其他原因因为我没有放弃私人而难以解释关于我们正在使用的公司的详细信息,以及我们使用消耗品的原因).这使我们可以让多个产品共享相同的价格.
当用户购买itemA(例如)时,该项目被解锁.但是,有时,当用户尝试成为itemB时,Apple会返回"您已经购买过此内容但尚未下载的内容".点按确定立即下载'.消费品肯定不会发生这种情况.我知道我们的系统非常复杂,但就苹果商店套件而言,只是再次购买相同的产品.
这可能只是一个沙箱问题吗?由于应用程序尚未发布,我们无法进行实时测试.事实上,由于我们的客户关注这个问题,所以这整个问题暂缓了发布.
我已经按照iphone文档中的相同代码和少数应用程序购买教程进行了操作.我看到论坛上的很多人似乎目睹了上面"已购买"的消费品产品对话,但没有一个能得到回应.
请帮忙!谢谢