File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -110,13 +110,15 @@ - (void)extractDataFromContext:(NSExtensionContext *)context withCallback:(void(
110110 **/
111111
112112 UIImage *sharedImage;
113- NSString *filePath = [ NSTemporaryDirectory () stringByAppendingPathComponent: @" RNSE_TEMP_IMG " ] ;
114- NSString *fullPath = [filePath stringByAppendingPathExtension: @" png " ] ;
115-
113+ NSString *filePath = nil ;
114+ NSString *fullPath = nil ;
115+
116116 if ([(NSObject *)item isKindOfClass: [UIImage class ]]){
117117 sharedImage = (UIImage *)item;
118+ fullPath = [NSTemporaryDirectory () stringByAppendingPathComponent: @" Image.png" ];
118119 }else if ([(NSObject *)item isKindOfClass: [NSURL class ]]){
119120 NSURL * url = (NSURL *)item;
121+ fullPath = [NSTemporaryDirectory () stringByAppendingPathComponent: url.lastPathComponent];
120122 NSData *data = [NSData dataWithContentsOfURL: url];
121123 sharedImage = [UIImage imageWithData: data];
122124 }
@@ -126,6 +128,7 @@ - (void)extractDataFromContext:(NSExtensionContext *)context withCallback:(void(
126128 if (callback) {
127129 callback (fullPath, [fullPath pathExtension ], nil );
128130 }
131+
129132 }];
130133 } else if (textProvider) {
131134 [textProvider loadItemForTypeIdentifier: TEXT_IDENTIFIER options: nil completionHandler: ^(id <NSSecureCoding > item, NSError *error) {
You can’t perform that action at this time.
0 commit comments