3

我必须在应用程序中获取用户 Amazon 电子邮件 ID,我正在使用最新的 Amazon LoginWithAmazon.framework。

登录时出现以下错误:

**Error Domain=AMZNLWAErrorDomain Code=8 "(null)" UserInfo={AMZNLWAErrorNonLocalizedDescription=Not authorized for requested operation}**

我在以下链接的帮助下完成了 iOS API 密钥生成: https ://developer.amazon.com/docs/login-with-amazon/register-ios.html

我的 Objective-C 代码片段通过配置文件范围获取 EmailID:

AMZNAuthorizeRequest *request = [[AMZNAuthorizeRequest alloc] init];
    request.scopes = [NSArray arrayWithObjects:
                      [AMZNProfileScope profile],nil];

    request.interactiveStrategy = AMZNInteractiveStrategyAuto;

    [[AMZNAuthorizationManager sharedManager] authorize:request
                                            withHandler:^(AMZNAuthorizeResult *result, BOOL
                                                          userDidCancel, NSError *error) {
                                                if (error) {

                                                    [AmazonHelper showAlert:@"Alert!" message:@"Unable to login amazon. Please try again later."];

                                                } else {
                                                    AMZNUser *user = result.user;
                                                   //NSString *userID = user.userID;


                                                }
                                            }];

我还添加了带有我的包 ID和 URL 方案的 URL 类型到amzn-“我的包 ID”以及 AppDelegate 深度链接各自的代表。同样在 info.plist 中添加了我的亚马逊 APIKey。

请帮我解决这个问题,因为这会阻止应用程序发布。

提前致谢,

4

0 回答 0