This is a migrated thread and some comments may be shown as answers.

Icenium Social Sharing Custom Plugin

16 Answers 205 Views
AppBuilder in-browser client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Developer
Top achievements
Rank 1
Developer asked on 20 Jan 2014, 04:01 PM
Hi all.
I have trouble to add social sharing plugin.
https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin
I used this plugin.
Here is test module.
 if (typeof window.plugins.socialSharing !== 'undefined'){
      // plugin is available
    alert("okay!");
        window.plugins.socialSharing.share('Message and subject', 'The subject');
    }else{
    alert("nope!");
    }
I can always get "nope!" alert.

and I used this on plugin.xml file and didn't import the SocialSharing.js on index.html.
 <js-module src="www/SocialSharing.js" name="SocialSharing">
    <clobbers target="plugins.socialsharing" />
  </js-module>

Please help me.

Thanks so much

16 Answers, 1 is accepted

Sort by
0
Jeelig
Top achievements
Rank 1
answered on 17 Feb 2014, 11:02 AM
Same here!
Let me know if you found something
0
Kaloyan
Telerik team
answered on 18 Feb 2014, 03:44 PM
Hello,

I managed to run the plugin by executing the following steps:
  1. First, I created a new blank project in AppBuilder;
  2. In it, I added the plugin from an archive (downloaded from GitHub);
  3. Next, I added the following in the iOS Config.xml:
    <feature name="SocialSharing">
      <param name="ios-package" value="SocialSharing" />
    </feature>

    and the following in the Android Config.xml:
    <feature name="SocialSharing">
      <param name="android-package" value="nl.xservices.plugins.SocialSharing"/>
    </feature>
  4. Inside the plugin.xml, I deleted the js-module:
    <js-module src="www/SocialSharing.js" name="SocialSharing">
      <clobbers target="window.plugins.socialsharing" />
    </js-module>
    and instead, I added asset to the SocialSharing.js file, like this:
    <asset src="www/SocialSharing.js" target="SocialSharing.js" />
  5. Finally, in the Index.html of the project I inserted a reference to the SocialSharing.js file:
    <script type="text/javascript" src="SocialSharing.js"></script>

    The whole Index.html:
    <!DOCTYPE html>
    <html>
        <head>
            <script type="text/javascript" src="SocialSharing.js"></script>
        </head>
        <body>
            <script>
                if (typeof SocialSharing !== 'undefined'){
                  // plugin is available
                alert("okay!");
                    SocialSharing.share('Message and subject', 'The subject');
                }else{
                alert("nope!");
                }
            </script>
        </body>
    </html>
  6. Building and deploying the app on a device resulted with 'okay!' alert.
I am attaching my project for your guidance.

Regards,
Kaloyan
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
0
Jeelig
Top achievements
Rank 1
answered on 18 Feb 2014, 04:23 PM
Thanks. You gotta be very lucky.
I imported the zip as a project and "bim"! "nope!"
I created a new project followed all the instructions and still "nope!".
Don't know what's wrong
0
Andres
Top achievements
Rank 1
answered on 18 Feb 2014, 04:56 PM
Hi Gilles, 

I had the same problem, my project always displays "nope!" and it was because my index.html had src="SocialSharing,js", but in telerik should be = "Plugins/SocialSharing-PhoneGap-Plugin-master/www/SocialSharing.js" if you import the plugin. Try to change this.

Regards.
0
Jeelig
Top achievements
Rank 1
answered on 18 Feb 2014, 06:19 PM
Yes! It works. Kinda...
I mean i have the "okay!" alert, but ... still unable to "share" items.
See attached
0
Jeelig
Top achievements
Rank 1
answered on 18 Feb 2014, 08:30 PM
My bad. Cordova.js was missing.
It works!
Thank you
0
Kaloyan
Telerik team
answered on 21 Feb 2014, 01:28 PM
Hi again Gilles,

I am glad that you have found a solution working on your side.

I want to apologize, as in my previous post I did not provide the best and recommended approach for configuring the Social Sharing plugin. I would like to do this now and it is only up to you if you wish to stick with the already working plugin, or change it.

As the Social Sharing plugin is Cordova Plugman compatible, it is a lot easier to integrate it inside an AppBuilder project. The next steps shows this. Note, the first two steps are the same as before:
  1. First, I created a new blank project in AppBuilder;
  2. In it, I added the plugin from an archive (downloaded from GitHub);
  3. Then, without changing or adding anything else, I check if the plugin is initialized after onDeviceReady. And if so, I share a message, like this (this is code from the index.js file):
    onDeviceReady: function() {
        app.receivedEvent('deviceready');
        navigator.splashscreen.hide();
        app.shareMsg();
    },
     
    shareMsg: function() {       
        if (typeof window.plugins.socialsharing !== 'undefined'){
          // plugin is available
            alert("Social Sharing plugin is initialized!");
            window.plugins.socialsharing.share('Message and subject', 'The subject');
        }else{
        alert("Social Sharing plugin is undefined!");
        }
    },

I have attached the new project for your guidance.

I hope you find this useful. Please, let me know if I can be of further assistance.

Regards,
Kaloyan
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
0
Robert
Top achievements
Rank 1
answered on 07 Apr 2014, 06:13 PM
This does not work. At all....

Robert Earnest Lassiter
0
Kaloyan
Telerik team
answered on 10 Apr 2014, 12:55 PM
Hello Robert,

This is highly unfortunate for us to hear. Could you elaborate a bit more on what is not working on your side in order to help you out?

Regards,
Kaloyan
Telerik
 

Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

 
0
kavin
Top achievements
Rank 1
answered on 20 May 2014, 03:56 AM
Hi all ...

Pls answer me ....

I have trouble to send and receive push notification from my server to both android and iphone devices ......

So please guide me for any plugin or website ......

Thank you all........




0
Jeelig
Top achievements
Rank 1
answered on 20 May 2014, 08:58 AM
Hi Kavin,
You should probably create a new subject in the forum, because the subject here was about social sharing plugin.
Anyway, I folowed this tutorial for notifications on iOS and it works pretty nice :
http://blogs.telerik.com/appbuilder/posts/14-01-14/let's-get-push-notifications-working-in-phonegap-and-ios
Hope it hleps
Cheers
0
kavin
Top achievements
Rank 1
answered on 21 May 2014, 03:48 AM
Thank U jeelig g ..............
0
Rodney
Top achievements
Rank 1
answered on 22 Sep 2014, 03:06 AM
This does not work for me either. I am using AppBuilder and download the latest Plugin from Telerik and import it into AppBuilder and use the JS code above and it does not recognize the JS code.

It does seem to work if I include the JS directly in my index.html
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="Plugins/SocialSharing-master/www/SocialSharing.js"></script>
0
Kaloyan
Telerik team
answered on 24 Sep 2014, 02:49 PM
Hello Rodney,

This is strange. Normally, you should be able to import the SocialSharing plugin from the Telerik Verified Plugins Marketplace. Then, you can check the sample app, or the usages examples and see if they work as expected on you side.

Please, do not hesitate to contact us again if there are any further issues.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Martin
Top achievements
Rank 1
answered on 25 Jun 2015, 09:43 AM

Hello,

Does anybody know an example of a custom plugin working within the current Telerik and Cordova version? I have been trying to get custom plugins to work for a couple of days now, but nothing is working. I have followed all the steps in this forum post, but i still get the 'nope!' alert. I tried both paths to the SocialSharing.js file. 

Thanks for your help in advance

 Regards Martin

0
Kaloyan
Telerik team
answered on 30 Jun 2015, 08:39 AM
Hello Martin,

If you are referring to my previous reply in this forum thread, I must say that it is a bit obsolete as now we completely depend on Plugman and all the custom Cordova plugins use js-module for including their javascript files in the project. This said, you will only need to import the custom plugins in the AppBuilder project in order to utilize their features. Here are the relevant articles for that:
 - Import custom Cordova plugins
 - Install Telerik Verified plugins

As for examples, you can check the Telerik Verified Plugins Marketplace sample applications, as you can directly clone them inside AppBuilder.

I hope this helps.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
AppBuilder in-browser client
Asked by
Developer
Top achievements
Rank 1
Answers by
Jeelig
Top achievements
Rank 1
Kaloyan
Telerik team
Andres
Top achievements
Rank 1
Robert
Top achievements
Rank 1
kavin
Top achievements
Rank 1
Rodney
Top achievements
Rank 1
Martin
Top achievements
Rank 1
Share this question
or