所以我使用AWS SNS向苹果设备发送推送通知.
我按照以下步骤操作:
当我向该EndPoint发布消息时:消息发布请求...但该通知永远不会出现在设备上.然后我检查端点和Enabled = false
希望有人可以提供帮助 谢谢.
amazon-web-services apple-push-notifications amazon-sns ios swift
我有一个代码知道哪个信标最接近,但是当信标的准确度为-1.00000时,我有一个问题,应用程序采用第二个.
因此,有一个布鲁克寻求最近的灯塔寻找其他人,并将最接近的灯塔与周围的其他灯塔进行比较.然后,当我知道哪个是最接近的那个时,我向用户显示它的视图,但是当其他信标靠近ipad时,视图关闭并且显示视图.
我在iPad上使用iOS 7.1和7.0.4,首先是iPad3,第二个是iPad Mini Retina.
在这里你有代码:
- (void)locationManager:(CLLocationManager *)manager didStartMonitoringForRegion:(CLRegion *)region {
[self.locationManager startRangingBeaconsInRegion:self.beaconRegion];
}
- (void)initRegion {
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"00000000-0000-0000-0000-000000000002"];
self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"com.devfright.myRegion"];
[self.locationManager startMonitoringForRegion:self.beaconRegion];
}
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
NSLog(@"Beacon Found");
[self.locationManager startRangingBeaconsInRegion:self.beaconRegion];
}
-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region {
NSLog(@"Left Region");
[self.locationManager stopRangingBeaconsInRegion:self.beaconRegion];
}
-(void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region {
CLBeacon *beacon = [[CLBeacon alloc] init];
CLBeacon *closestBeacon = [[CLBeacon alloc] init];
closestBeacon = [beacons lastObject];
//Search for …Run Code Online (Sandbox Code Playgroud) 我实际上收到了带有JSON和消息的通知,所以我想要的是处理该通知并将其显示给用户.
当应用程序未运行或在后台运行时,会显示该消息,但是当应用程序打开时,则不会显示任何通知.事实上,我在收到时会收到json didReceiveRemoteNotification,但我想要的是像whatsapp那样的通知框.
像这样:
我有这个:
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
print("Notification received: \(userInfo)")
let notification = userInfo["aps"] as? NSDictionary
let message = notification?.valueForKey("alert")
}
Run Code Online (Sandbox Code Playgroud)
这在'didfinishlaunchWithOptions'中
let readAction = UIMutableUserNotificationAction()
readAction.identifier = "READ_IDENTIFIER"
readAction.title = "Read"
readAction.activationMode = UIUserNotificationActivationMode.Foreground
readAction.destructive = false
readAction.authenticationRequired = true
let deleteAction = UIMutableUserNotificationAction()
deleteAction.identifier = "DELETE_IDENTIFIER"
deleteAction.title = "Delete"
deleteAction.activationMode = UIUserNotificationActivationMode.Foreground
deleteAction.destructive = true
deleteAction.authenticationRequired = true
let ignoreAction = UIMutableUserNotificationAction()
ignoreAction.identifier = "IGNORE_IDENTIFIER"
ignoreAction.title = "Ignore"
ignoreAction.activationMode = …Run Code Online (Sandbox Code Playgroud) 我在导航栏中的标题视图有问题。问题是当我将视图分配到 titleView 时它没有显示。我尝试使用navigationItem.title = @"eqweqweq";但没有任何反应。
所涉及的这个视图是由代码创建的,我不知道这是否是问题,因为我使用过的其他 ViewControllers 工作得很好。
iOS 10 中是否存在无法使用 titleView 的错误?有时它起作用有时不起作用。
我在谷歌上搜索过,但没有任何帮助。希望有人能帮帮我T_T。
谢谢你