LoginSignup
3
2

More than 5 years have passed since last update.

【ダメだ〜】iOS8のLocalNotificationで位置情報をフックする

Posted at

気づいたらNitificationに位置情報が追加されたので、いろいろ試してみたけどダメだ!
前々領域観測してくれない。

設定等もけっこう見直してるがダメだ・・・

    class func setNotification(center:CLLocationCoordinate2D, title:String, id:String)
    {        
        //NSLog("set notification:%f,%f - %@",center.latitude,center.longitude, id)
        var locNotification:UILocalNotification = UILocalNotification()
        locNotification.regionTriggersOnce = true
        locNotification.alertBody=title
        locNotification.userInfo = ["id":id];
        locNotification.category = "custom"
        locNotification.region = CLCircularRegion(circularRegionWithCenter: center, radius: 100.0, identifier: "delete")
        UIApplication.sharedApplication().scheduleLocalNotification(locNotification)
    }

結局、locationManagerをバックグラウンドで動かして領域観測している・・・

3
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2