使用UIActivityViewController共享图像和URL对于facebook和gmail工作正常但对whatsapp无效.这是我使用的代码
- (void)share {
UIScreen *screen = [UIScreen mainScreen];
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
UIGraphicsBeginImageContextWithOptions(screen.bounds.size, NO, 0);
[keyWindow drawViewHierarchyInRect:keyWindow.bounds afterScreenUpdates:YES];
UIImage *snapShotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImage *imageToShare = snapShotImage;
NSURL *urlToShare = [NSURL URLWithString:@"http://google.com"];
NSMutableArray *activityItems = [NSMutableArray arrayWithObjects:urlToShare, imageToShare, nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
activityViewController.excludedActivityTypes = @[
UIActivityTypePrint,
UIActivityTypeCopyToPasteboard,
UIActivityTypeAssignToContact,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypeAirDrop];
[self presentViewController:activityViewController animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
注意:在继续之前,我们需要从activityviewcontroller解决方案中找到这个隐藏的whatsapp
由于以下原因,我的应用被拒绝了。
10.6详细信息我们注意到,用户被带到Safari登录或注册帐户,这带来了糟糕的用户体验。
下一步
请修改您的应用,以允许用户登录或在该应用中注册帐户。
我们建议实现Safari View Controller API,以在您的应用程序中显示Web内容。Safari View Controller允许显示URL并通过应用程序中的嵌入式浏览器检查证书,以便客户可以验证网页URL和SSL证书,以确认他们将登录凭据输入到合法页面中。
资源资源
有关Safari View Controller API的其他信息,请参阅网页Safari新增功能。
我正在使用Facebook和Google Plus登录。这是因为Facebook或Google Plus登录吗?因为如果用户设备上未安装Facebook / Google plus应用,则它将为Facebook / Google +登录页面启动Safari /默认浏览器。我以前构建的二进制文件已由Apple批准,直到现在我还没有对signIn / register流进行任何更改。
我正在考虑实施他们的建议,但是我无法直视Safari View Controller API在您的应用程序中显示Web内容。如何使用Safari View控制器显示Facebook / Google +登录页面?我有点卡在这里。如果有人可以分享有关此问题的任何想法,将不胜感激。
在尝试集成Azure AD B2C时,我遇到了错误"oauthConnection Error:Bad Request".按照他们给出的示例应用程序,一切正常.但是,在从工作示例应用程序集成相同的复制粘贴代码并尝试使用Facebook或Google Plus登录后,它会抛出错误!我很确定我在示例应用中使用的每个凭据对于我的应用都是一样的.对此有任何想法将受到高度赞赏.这是我的代码, AppDelegate.m
#import "AppData.h"
#import "NXOAuth2.h"
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self setupOAuth2AccountStore];
// Override point for customization after application launch.
return YES;
}
- (void)setupOAuth2AccountStore {
AppData *data = [AppData getInstance]; // The singleton we use to get the settings
NSDictionary *customHeaders =
[NSDictionary dictionaryWithObject:@"application/x-www-form-urlencoded"
forKey:@"Content-Type"];
// Azure B2C needs
// kNXOAuth2AccountStoreConfigurationAdditionalAuthenticationParameters for
// sending policy to the server, …Run Code Online (Sandbox Code Playgroud)