iOS8 - - 一些适配

来源:互联网 发布:签名设计软件免费版 编辑:程序博客网 时间:2024/06/04 22:27

1:Attempting to badge the application icon but haven't received permission from the user to badge the application

    大概意思就是要用badge the application icon要获得用户的同意

我已经忘了需要在哪设置了,所以我在

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

  里面 设置了一下

if(IOS_VERSION>=8.0){

        NSLog(@"ios8");

        UIUserNotificationSettings *settings = [UIUserNotificationSettingssettingsForTypes:UIUserNotificationTypeBadgecategories:nil];

        [[UIApplicationsharedApplication]registerUserNotificationSettings:settings];

    }


2;Xcode6/iOS8 SDK 编译SDWebImage SDWebImageDownloaderOperation.m报错

报错:Use of undeclared identifier '_executing' / '_finished';

解决方法:在SDWebImageDownloaderOperation类的实现中添加:@synthesize executing = _executing ; @synthesize finished = _finished;即可。


3:UIMoviePlayerControllerDidExitFullscreenNotification NSNotification not working in iOS 8

    UIWebView上播放视频,获取全屏播放事件/退出全屏播放

之前的办法:

 [[NSNotificationCenter defaultCenter]addObserver:selfselector:@selector(enterFullScreen:)

                                                            name:@"UIMoviePlayerControllerDidEnterFullscreenNotification"object:nil];

        [[NSNotificationCenter defaultCenter]addObserver:selfselector:@selector(exitFullScreen:)

                                                            name:@"UIMoviePlayerControllerDidExitFullscreenNotification"object:nil];

iOS8 里面的方法

 [[NSNotificationCenterdefaultCenter]addObserver:self

                                                     selector:@selector(enterFullScreen:)

                                                         name:@"AVPlayerItemBecameCurrentNotification"

                                                       object:nil];


 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitedFullScreen:) 

                                          name:UIWindowDidBecomeHiddenNotification object:nil];


4:解决iOS8安装企业版无反应问题

iOS7可以下载没有任何问题,iOS8发现挂在官网上的企业版的app点击了提示是否安装应用程序,但是确认以后没有反应,找了很久,都没有发现问题。后来查看了的device console发现安装的时候出现

<span style="font-size:18px;">  LoadExternalDownloadManifestOperation: Ignore manifest download, already have bundleID: com.mycom.MyApp</span>

后来查资料外国开发者推测是iOS8的一个bug:

The biggest issue for us is that we can not reproduce this onany of our devices. Our suspicion is that iOS 8 has some internalcache with bundle IDs and just doesn't install a build if it thinksthat an app with this bundle ID is already installed. As theinstallation doesn't even start, we think that iOS is matching thebundle identifier from the manifest plist against this cache.

它会寻找是否ios缓存的identifier与bundle identifier在plist文件中匹配,如果匹配,它会认为已经安装了,就不会有反应。 上面解释的很清楚。所以解决办法就是在plist文件中修改bundle Identifier。

比如你的plist文件的BundleID是com.mycom.MyApp,则修改成com.mycom.MyApp.fixios8。(创建一个假的bundleID,可以随便取,这样ios就不会认为你已经安装。记住是修改plist文件的bundleID,不是应用程序的bundleID)

发布以后就发现可以了。只是如果你已经安装了app,则会出现一个新的下载的空白icon,因为这个app的bundleID与你plist的bundleID不一致,当下载完成后,会覆盖原本app,因为它会检测到下载安装的app的bundleID已经存在并且覆盖。

完美解决。

5:解决跳转到系统设置里自己App的页面

在iOS5.0时时可以跳转到系统的设置页的。但是在5.1之后就不可以了。

刚才研究了下这个问题,发现只有iOS8可以跳转到系统设置里自己App的页面。

目前没有找到iOS7怎么跳转过去。如果你知道请一定要留言告知,Thanks!

下面说下iOS8是如何跳转的,以下是代码:

NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];if ([[UIApplication sharedApplication] canOpenURL:url]) {   [[UIApplication sharedApplication] openURL:url];}




0 0
原创粉丝点击