alinz / react-native-share-extension

react-native as an engine to drive share extension
MIT License
762 stars 397 forks source link

Sharing image on IOS , returns no data . #149

Open JsonAveza opened 5 years ago

JsonAveza commented 5 years ago

Hi Team,

I am trying to share url and image from mobile to app using react-native-share-extension. I can pass url from safari to my app , but i can not pass the image to my app. I try to find the log to check the result of image sharing, not get any results from ([imageProvider loadItemForTypeIdentifier:IMAGE_IDENTIFIER options:nil completionHandler:^(id item, NSError *error) {). item always null.

"react-native-share-extension": "^1.2.1" "react-native": "0.59.2",

Thank You

fishkingsin commented 5 years ago

I hacked the soruce change

RCT_REMAP_METHOD(data,
                 resolver:(RCTPromiseResolveBlock)resolve
                 rejecter:(RCTPromiseRejectBlock)reject)

to

RCT_EXPORT_METHOD(data:(NSDictionary*)options
                 resolver:(RCTPromiseResolveBlock)resolve
                 rejecter:(RCTPromiseRejectBlock)reject)