Skip to content

Commit

Permalink
fix(social-sharing): shareViaEmail now resolves/rejects when not prov…
Browse files Browse the repository at this point in the history
…iding optional args
  • Loading branch information
ihadeed committed Sep 7, 2016
1 parent ddae679 commit c76de34
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/plugins/socialsharing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class SocialSharing {
*/
@Cordova({
successIndex: 5,
errorIndex: 6
errorIndex: 6,
platforms: ['iOS', 'Android']
})
static canShareVia(appName: string, message?: string, subject?: string, image?: string, url?: string): Promise<any> { return; }
Expand All @@ -77,7 +77,7 @@ export class SocialSharing {
*/
@Cordova({
successIndex: 3,
errorIndex: 4
errorIndex: 4,
platforms: ['iOS', 'Android']
})
static shareViaTwitter(message: string, image?: string, url?: string): Promise<any> { return; }
Expand All @@ -91,7 +91,7 @@ export class SocialSharing {
*/
@Cordova({
successIndex: 3,
errorIndex: 4
errorIndex: 4,
platforms: ['iOS', 'Android']
})
static shareViaFacebook(message: string, image?: string, url?: string): Promise<any> { return; }
Expand All @@ -107,7 +107,7 @@ export class SocialSharing {
*/
@Cordova({
successIndex: 4,
errorIndex: 5
errorIndex: 5,
platforms: ['iOS', 'Android']
})
static shareViaFacebookWithPasteMessageHint(message: string, image?: string, url?: string, pasteMessageHint?: string): Promise<any> { return; }
Expand All @@ -132,7 +132,7 @@ export class SocialSharing {
*/
@Cordova({
successIndex: 3,
errorIndex: 4
errorIndex: 4,
platforms: ['iOS', 'Android']
})
static shareViaWhatsApp(message: string, image?: string, url?: string): Promise<any> { return; }
Expand All @@ -147,7 +147,7 @@ export class SocialSharing {
*/
@Cordova({
successIndex: 4,
errorIndex: 5
errorIndex: 5,
platforms: ['iOS', 'Android']
})
static shareViaWhatsAppToReceiver(receiver: string, message: string, image?: string, url?: string): Promise<any> { return; }
Expand Down Expand Up @@ -177,15 +177,17 @@ export class SocialSharing {
* @param message {string}
* @param subject {string}
* @param to {string[]}
* @param cc {string[]}
* @param bcc {string[]}
* @param files {string|string[]} URL or local path to file(s) to attach
* @param cc {string[]} Optional
* @param bcc {string[]} Optional
* @param files {string|string[]} Optional URL or local path to file(s) to attach
* @returns {Promise}
*/
@Cordova({
platforms: ['iOS', 'Android']
platforms: ['iOS', 'Android'],
successIndex: 6,
errorIndex: 7
})
static shareViaEmail(message: string, subject: string, to: string[], cc: string[] = [], bcc: string[] = [], files: string|string[] = []): Promise<any> { return; }
static shareViaEmail(message: string, subject: string, to: string[], cc?: string[], bcc?: string[], files?: string|string[]): Promise<any> { return; }

/**
* Share via AppName
Expand All @@ -198,7 +200,7 @@ export class SocialSharing {
*/
@Cordova({
successIndex: 5,
errorIndex: 6
errorIndex: 6,
platforms: ['iOS', 'Android']
})
static shareVia(appName: string, message: string, subject?: string, image?: string, url?: string): Promise<any> { return; }
Expand Down

0 comments on commit c76de34

Please sign in to comment.