5
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; 

@synchronized (session) 
{ 
    [[session downloadTaskWithURL:attachmentURL 
       completionHandler:^(NSURL *temporaryFileLocation, NSURLResponse *response, NSError *error) { 
        if (error != nil) { 
         NSLog(@"error.localizedDescription %@", error.localizedDescription); 
        } else { 
         NSFileManager *fileManager = [NSFileManager defaultManager]; 
         NSURL *localURL = [NSURL fileURLWithPath:[temporaryFileLocation.path stringByAppendingString:fileExt]]; 
         [fileManager moveItemAtURL:temporaryFileLocation toURL:localURL error:&error]; 

         NSError *attachmentError = nil; 
         attachment = [UNNotificationAttachment attachmentWithIdentifier:@"" URL:localURL options:nil error:&attachmentError]; 
         if (attachmentError) { 
          NSLog(@"attachmentError.localizedDescription %@", attachmentError.localizedDescription); 
         } 
        } 
        completionHandler(attachment); 
       }] resume]; 
} 

プッシュ通知にFCMを使用しています。エラー__NSCFLocalDownloadFileエラー2作成時の温度

{ 
"to": "ffHjl2CblrI...", 
"data": { 
    "message": "Offer!", 
    "image": "https://media.giphy.com/media/l4lR0Q5u91kTNJPsA/giphy.gif", 
    "url": custom url, 
    "mediaType": "gif", 
    "type": "notification type" 
}, 
"notification": { 
    "body": "Body", 
    "sound": "default", 
    "title": "Title" 
}, 
"content_available": true, 
"mutable_content": true 
} 

これは私のペイロードコンテンツです。

プッシュ通知からデータをダウンロードするために使用しているコードの上にNotificationExtensionを使用しています。

私は開発者の証明書から成功した応答を得ました。私は生産証明書(前のものとアップデート)に確認した場合、私はアプリを削除し、それが働いて再び実行している場合、私はこの

__NSCFLocalDownloadFile: error 2 creating temp file: /private/var/mobile/Containers/Data/PluginKitPlugin/7D6B57B4-DC4D-4F3E-8113-C8469BA66BBB/tmp/CFNetworkDownload_NQQfGi.tmp

のようなエラーが発生しました。しかし、新しいIPAでバージョンを更新すると、通知のイメージが表示されません。

私が見逃しているのは、その証明書の問題ですか?アプリのパーミッションに問題はありますか?

UNNotificationServiceExtensionに別のAPP ID(プッシュ通知設定なし)を使用しています。

更新

は、あまりにも動作していないことにAPNSでチェック。

さらにいくつかのコードと説明、私はPESIXErrorDomainに属し、このエラーに遭遇していると私は」

  1. Richmedia notification notification not working in production certifcate

  2. Rich push notification not work properlly after update IPA (same IPA with overwirtten)

答えて