Comments (4)
... so this is what I ended up doing... may be better for the plugin to do the callback when the user has actually completed their share...
[activityVC setCompletionHandler:^(NSString *activityType, BOOL completed) {
CDVPluginResult * pluginResult;
if (completed) {
NSString *network;
if ([activityType rangeOfString:@"Twitter"].location != NSNotFound ) {
network = @"twitter";
} else if ([activityType rangeOfString:@"Facebook"].location != NSNotFound ) {
network = @"facebook";
} else {
network = @"mail";
}
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:network];
} else {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
}
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}];
It's not pretty, but it's working for what I need it for at the moment.
Thanks!
--d
from socialsharing-phonegap-plugin.
Hi,
Glad you found a way!
I'll keep this issue open and consider adding such feedback to the successhandler. Thanks for the idea!
Best,
Eddy
from socialsharing-phonegap-plugin.
I'm using this
[activityVC setCompletionHandler:^(NSString *activityType, BOOL completed) {
if (completed)
{
CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self writeJavascript:[pluginResult toSuccessCallbackString:command.callbackId]];
}
}];
and works fine for me.
from socialsharing-phonegap-plugin.
Hi,
I've opted for the solution of @felipecarreramo, because I think it's mostly useful for the user to know IF content was shared, not HOW. I may add the HOW in a later stage, but the code would be a bit messy. So for the IF part, I had to slightly adjust the aforementioned code.
When opening the share widget succeeds, the plugin considers it a success. The result is not returned to the app before the content is actually shared to a target app, or the share widget is closed, or sharing is aborted otherwise. Only in the first case the successCallback will receive a boolean TRUE, it's FALSE otherwise.
Thanks again guys,
Eddy
from socialsharing-phonegap-plugin.
Related Issues (20)
- app crash on share HOT 5
- Sharing message in message in IOS
- Sharing base64 encoded text/csv files fails on newer Android versions HOT 2
- bh.sh
- bh.sh
- Issue with IOS Social Sharing in ios 15
- screen frozen after share via facebook HOT 2
- Intent Redirection Vulnerability
- Share blob or base64 encoded image HOT 1
- Android 13 devices error on share with Twitter or Facebook HOT 6
- Android 12 issue HOT 4
- YouTube not supported as a valid app in iOS Share Sheet?
- App close after share whatsapp last version android
- Preview not available on Facebook share
- Instagram Story
- Can webp format files be saved
- ios 15 and 16 share file problem
- Crash on calling canShareVia -[SocialSharing canShareVia:] on IOS device
- Android app crashed when share through email HOT 7
- IOS trouble on sharing to Facebook and Instagram. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socialsharing-phonegap-plugin.