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
에 속하는이 오류를 발생하고 나는 '
Richmedia notification notification not working in production certifcate
Rich push notification not work properlly after update IPA (same IPA with overwirtten)