Tag: apple push notifications

在iOS 10中使用远程通知(富媒体推送通知)在通知栏中显示图像

我已经整合了APNS,并希望像下面那样在远程通知中显示图像; 我用下面的代码引用链接 ; AppDelegate.h #import <UserNotifications/UserNotifications.h> @interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate> AppDelegate.m – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self registerForRemoteNotification]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *vc1 = [storyboard instantiateViewControllerWithIdentifier:@"mainscreen"]; self.window.rootViewController = vc1; return YES; } – (void)registerForRemoteNotification { if(SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(@"10.0")) { UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self; [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | […]

没有使用Parse Push和Xamarin IOS注册的设备

我正尝试使用Parse Push和Xamarin IOS设置推送通知。 我遵循这些指南: https://www.parse.com/docs/dotnet/guide#push-notifications-push-on-xamarin-ios https://www.parse.com/apps/quickstart#parse_push/ios/xamarin/existing https: //developer.xamarin.com/guides/cross-platform/application_fundamentals/notifications/ios/remote_notifications_in_ios/ https://groups.google.com/forum/#!topic/parse-developers/65WAfRIiEnA 从我的理解,我修改了我的AppDelegate, 我把这个添加到构造函数中: ParseClient.Initialize("MY APP ID", "MY DOT NET KEY"); 用适当的钥匙。 我将其添加到FinishedLaunching方法 if (Convert.ToInt16(UIDevice.CurrentDevice.SystemVersion.Split('.')[0].ToString()) < 8) { UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound; UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes); } else { UIUserNotificationType notificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound; var settings = UIUserNotificationSettings.GetSettingsForTypes(notificationTypes, new NSSet(new string[] { })); UIApplication.SharedApplication.RegisterUserNotificationSettings(settings); […]

voip app ios8:pushkit仍然是最佳做法?

我正在开发一个应用程序,需要可靠的推送消息(如任何voip)在ios9下。 这里说,用IOS8 +应该使用apns(registerForRemoteNotifications): https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/occ/instm/UIApplication/setKeepAliveTimeout:handler : 在Optimize VOIP Apps文档中,Pushkit是首选: https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html#//apple_ref/doc/uid/TP40015243-CH30-SW1 有人有这个线索吗? 或者他们在后台运行相同的代码?

IOS 8静默推送通知不工作,没有Xcode

我试图testing静默推送通知,我注意到我的iPhone(IOS 8)只能在我的设备连接到Xcode时收到无声的通知。 在拔掉电源插头的时候,我只能在5-10次尝试中收到一个沉默的推动。 这只会发生在IOS 8,因为我有另一个电话是在IOS 7上运行,甚至没有一个单一的沉默推。 任何人都面临同样的问题? 更多详细信息:如果手机连接到电源,我可以完美地安静地推送通知…

iOS:如何注册推送通知?

我试图通过Ray Wenderlich的指南为我的iOS 5应用程序实现推送通知: http ://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12。 我在我的AppDelegate中将下面的代码插入到我的didFinishLaunchingWithOptions方法中: [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; 在我的设备(不是模拟器)上运行应用程序时,不会显示popup窗口/警告,告诉我接受推送通知。 我已经插入了一个debugging点,我可以看到, registerForRemoteNotificationTypes被调用。 为什么没有发生?

安全发送设备令牌给APNs

对于需要推送通知的iOS应用程序,它必须首先请求用户许可。 之后,生成设备令牌,由此,远程服务器可以通过该令牌与用户通信。 我在这里读了一个类似的问题,我觉得这不够。 下面的图片是一个可信的证书,它允许我查看在这个设备上发生的所有stream量。 使用Fiddler2以及CertMaker ,我可以嗅探HTTPSstream量,这意味着客户端可能知道他们正在发送的数据以及到哪里。 我的问题是,知道SSL不安全,无法保护我的客户看到我发送给远程服务器,我应该简单地用我的应用程序中find的密钥encryption? 比如encrypt("device_token","secretkey_a0a0a0a") (假装这是Objective-C)? 难道有人不能在我的应用程序中find这个键吗? 我也读过这个问题,似乎有可能找回密钥。 我的计划是这样的: 在iOS应用程序中,生成一个名为activate的随机string。 encryption(而不是散列),令牌由随机string和一个我只知道的密钥组成。 (secretkey_a0a0a0) 将encryption的string与生成的随机生成的string(活动)一起发送。 在服务器端,我检查是否可以使用active密钥和我的密钥解密一个有效的令牌。 如果该标记有效,我会将标记保存在我的数据库中。 这可以防止人们随意input令牌yes,但是, secretkey_a0a0a0是一个string文字。 这很有可能在应用程序二进制文件中得到它。 我的问题是,我如何保护这个密钥? 答案也可以是,如何防止人们向我的服务器发送无效令牌。 我听说过encryption,但是这不只适用于资源文件? 我应该如何处理这个?

如何使您的推送通知打开某个视图控制器?

我看了一下,但是我没能find任何问题来讨论什么时候你收到一个推送通知你怎么能打开一个特定的视图控制器。 例如,如果您正在创build一个类似WhatsApp的应用程序,并且您收到两个不同的推送通知,即来自两个不同用户的消息,那么您将如何从应用程序代理指向相应的viewController? 据我所知,在用户信息字典中,appDelegate给你你可以给一个特定的viewController ID,但我不知道如何向任何特定的视图控制器致敬,那么你可以再次指向该viewController 。 请在您的答案中包含代码片段 **** Swift或Objective-C的答案都可以接受****

iOS 8推送通知操作button – 当应用程序处于后台时,handleActionWithIdentifier中的代码不会始终运行

我将两个操作button添加到iOS 8上的推送通知:“ Acceptbutton和Denybutton。 这两个button都不会打开应用程序,但是不同的服务器请求将取决于按下哪个button。 这是我的设置: + (void)requestForPushNotificationToken { UIApplication *application = [UIApplication sharedApplication]; // if ios 8 or greater if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) { UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init]; [acceptAction setActivationMode:UIUserNotificationActivationModeBackground]; [acceptAction setTitle:@"Accept"]; [acceptAction setIdentifier:@"ACCEPT_ACTION"]; [acceptAction setDestructive:NO]; [acceptAction setAuthenticationRequired:NO]; UIMutableUserNotificationAction *denyAction = [[UIMutableUserNotificationAction alloc] init]; [denyAction setActivationMode:UIUserNotificationActivationModeBackground]; [denyAction setTitle:@"Deny"]; [denyAction setIdentifier:@"DENY_ACTION"]; [denyAction setDestructive:NO]; [denyAction setAuthenticationRequired:NO]; […]

如何生成开发MDM / APNS证书?

我们已经采取iOS开发者企业帐户,并且我们已经收到了以.pem格式的MDM证书。我们已经从门户https://identity.apple.com/pushcert/下载了这个MDM证书。但是我们不知道这是生产MDM证书或开发MDM证书。 首先,我们要使用开发证书来testingMDM命令,在获得MDM有效载荷后,我们可以继续生产。 所以我的问题是如何创build可用于从gateway.sandbox.push.apple.com获取MDM推送通知的MDM / APNS证书(如果可能的话)。 我已经通过这个 pdf,但没有得到公平的发展MDM推送通知的想法。 任何帮助将不胜感激。

推送通知设备令牌?

如何从我的iPhone设备获取设备令牌?