Giter VIP home page Giter VIP logo

phonegap-plugins's Introduction

Former home of Plugins for PhoneGap and Apache Cordova

===

This repo has been deprecated

This repo has been deprecated and will not be actively maintained - no pull requests nor any other issues will be worked on. The previous source currently exists in the DEPRECATED branch, and may be removed at a future date.

If you had a plugin in this repo, you will have to migrate it to your own repo, and create a plugin.xml file according to the Cordova Plugin Spec, and optionally push it to the Cordova Plugin Registry.

phonegap-plugins's People

Contributors

alexdrel avatar andidog avatar andrewpthorp avatar ascorbic avatar brianantonelli avatar broderix avatar brycecurtis avatar devgeeks avatar drewdahlman avatar dshookowsky avatar ecamacho avatar grandecomplex avatar josemando avatar keenan avatar kerrishotts avatar macdonst avatar manijshrestha avatar max-mapper avatar mgcrea avatar obrand avatar paulb777 avatar pmuellr avatar purplecabbage avatar randymcmillan avatar ranhiru avatar red-folder avatar shazron avatar tf avatar triceam avatar ttopholm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phonegap-plugins's Issues

TTS upgrade to add callback function when speak is finished

Here the code I have done to add a callback function. You can modify it as you want, I don't think that the name of variable are very good.

for tts.js

/*
 * PhoneGap is available under *either* the terms of the modified BSD license *or* the
 * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
 * 
 * Copyright (c) 2011, IBM Corporation
 */

/**
 * Constructor
 */
function TTS() {
}

TTS.STOPPED = 0;
TTS.INITIALIZING = 1;
TTS.STARTED = 2;

/**
 * Play the passed in text as synthasized speech
 * 
 * @param {DOMString} text
 * @param {Object} successCallback
 * @param {Object} errorCallback
 */
TTS.prototype.speak = function(text, successCallback, errorCallback) {
     return PhoneGap.exec(successCallback, errorCallback, "TTS", "speak", [text]);
};

/** 
 * Play silence for the number of ms passed in as duration
 * 
 * @param {long} duration
 * @param {Object} successCallback
 * @param {Object} errorCallback
 */
TTS.prototype.silence = function(duration, successCallback, errorCallback) {
     return PhoneGap.exec(successCallback, errorCallback, "TTS", "silence", [duration]);
};

/**
 * Starts up the TTS Service
 * 
 * @param {Object} successCallback
 * @param {Object} errorCallback
 */
TTS.prototype.startup = function(successCallback, errorCallback) {
     return PhoneGap.exec(successCallback, errorCallback, "TTS", "startup", []);
};

/**
 * Shuts down the TTS Service if you no longer need it.
 * 
 * @param {Object} successCallback
 * @param {Object} errorCallback
 */
TTS.prototype.shutdown = function(successCallback, errorCallback) {
     return PhoneGap.exec(successCallback, errorCallback, "TTS", "shutdown", []);
};

/**
 * Finds out if the language is currently supported by the TTS service.
 * 
 * @param {DOMSting} lang
 * @param {Object} successCallback
 * @param {Object} errorCallback
 */
TTS.prototype.isLanguageAvailable = function(lang, successCallback, errorCallback) {
     return PhoneGap.exec(successCallback, errorCallback, "TTS", "isLanguageAvailable", [lang]);
};

/**
 * Finds out the current language of the TTS service.
 * 
 * @param {Object} successCallback
 * @param {Object} errorCallback
 */
TTS.prototype.getLanguage = function(successCallback, errorCallback) {
     return PhoneGap.exec(successCallback, errorCallback, "TTS", "getLanguage", []);
};

/**
 * Sets the language of the TTS service.
 * 
 * @param {DOMString} lang
 * @param {Object} successCallback
 * @param {Object} errorCallback
 */
TTS.prototype.setLanguage = function(lang, successCallback, errorCallback) {
     return PhoneGap.exec(successCallback, errorCallback, "TTS", "setLanguage", [lang]);
};

/**
 * Sets callback function of the TTS service.
 * 
 * @param {DOMString} js
 */
TTS.prototype.setCallbackFct = function(js, successCallback, errorCallback) {
     return PhoneGap.exec(successCallback, errorCallback, "TTS", "setCallbackFct", [js]);
};

/**
 * Load TTS
 */ 
PhoneGap.addConstructor(function() {
    PhoneGap.addPlugin("tts", new TTS());
// @deprecated: No longer needed in PhoneGap 1.0. Uncomment the addService code for earlier 
// PhoneGap releases.
//     PluginManager.addService("TTS", "com.phonegap.plugins.speech.TTS");
});

And for TTS.java

/*
 * PhoneGap is available under *either* the terms of the modified BSD license *or* the
 * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
 * 
 * Copyright (c) 2011, IBM Corporation
 */

package com.phonegap.plugins.speech;

import java.util.HashMap;
import java.util.Locale;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.content.Context;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener;

import com.phonegap.api.Plugin;
import com.phonegap.api.PluginResult;

public class TTS extends Plugin implements OnInitListener, OnUtteranceCompletedListener {

    private static final String LOG_TAG = "TTS";
    private static final int STOPPED = 0;
    private static final int INITIALIZING = 1;
    private static final int STARTED = 2;
    private TextToSpeech mTts = null;
    private int state = STOPPED;
    private String callbackFct = null;

    private String startupCallbackId = "";

    @Override
    public PluginResult execute(String action, JSONArray args, String callbackId) {
        PluginResult.Status status = PluginResult.Status.OK;
        String result = "";


        try {
            if (action.equals("speak")) {
                String text = args.getString(0);
                if (isReady()) {
                    HashMap<String, String> map = null;
                    if (this.callbackFct != null){
                        map = new HashMap<String, String>();
                        map.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "Speak Completed");
                    }
                    mTts.speak(text, TextToSpeech.QUEUE_ADD, map);
                    return new PluginResult(status, result);
                } else {
                    JSONObject error = new JSONObject();
                    error.put("message","TTS service is still initialzing.");
                    error.put("code", TTS.INITIALIZING);
                    return new PluginResult(PluginResult.Status.ERROR, error);
                }
            }  
            else if (action.equals("silence")) {
                if (isReady()) {
                    mTts.playSilence(args.getLong(0), TextToSpeech.QUEUE_ADD, null);
                    return new PluginResult(status, result);
                } else {
                    JSONObject error = new JSONObject();
                    error.put("message","TTS service is still initialzing.");
                    error.put("code", TTS.INITIALIZING);
                    return new PluginResult(PluginResult.Status.ERROR, error);
                }
            }
            else if (action.equals("startup")) {
                if (mTts == null) {
                    this.startupCallbackId = callbackId;
                    state = TTS.INITIALIZING;
                    mTts = new TextToSpeech(this.ctx, this); //getContext previously
                    //mTts.setLanguage(Locale.US);          
                }                               
                PluginResult pluginResult = new PluginResult(status, TTS.INITIALIZING);
                pluginResult.setKeepCallback(true);
                return pluginResult;
            }
            else if (action.equals("shutdown")) {
                if (mTts != null) {
                    mTts.shutdown();
                }
                return new PluginResult(status, result);
            }
            else if (action.equals("getLanguage")) {
                if (mTts != null) {
                    result = mTts.getLanguage().toString();
                    return new PluginResult(status, result);
                }
            }
            else if (action.equals("isLanguageAvailable")) {
                if (mTts != null) {
                    Locale loc = new Locale(args.getString(0));
                    int available = mTts.isLanguageAvailable(loc);
                    result = (available < 0) ? "false" : "true";
                    return new PluginResult(status, result);
                }
            }
            else if (action.equals("setLanguage")) {
                if (mTts != null) {
                    Locale loc = new Locale(args.getString(0));
                    int available = mTts.setLanguage(loc);
                    result = (available < 0) ? "false" : "true";
                    return new PluginResult(status, result);
                }
            }
            else if (action.equals("setCallbackFct")) {
                String js = args.getString(0);
                this.callbackFct = js;
            }
            return new PluginResult(status, result);
        } catch (JSONException e) {
            e.printStackTrace();
            return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
        }
    }

    /**
     * Is the TTS service ready to play yet?
     * 
     * @return
     */
    private boolean isReady() {
        return (state == TTS.STARTED) ? true : false;
    }

    /**
     * Called when the TTS service is initialized.
     * 
     * @param status 
     */
    public void onInit(int status) {
        if (status == TextToSpeech.SUCCESS) {
            mTts.setOnUtteranceCompletedListener(this);
            state = TTS.STARTED;
            PluginResult result = new PluginResult(PluginResult.Status.OK, TTS.STARTED);
            result.setKeepCallback(false);
            this.success(result, this.startupCallbackId);
        }
        else if (status == TextToSpeech.ERROR) {
            state = TTS.STOPPED;
            PluginResult result = new PluginResult(PluginResult.Status.ERROR, TTS.STOPPED);
            result.setKeepCallback(false);
            this.error(result, this.startupCallbackId);
        }
    }

    public void onUtteranceCompleted(String utteranceId) {
            this.sendJavascript(this.callbackFct);
    }

    /** 
     * Clean up the TTS resources
     */
    public void onDestroy() {
        if (mTts != null) {
            mTts.shutdown();
        }
    }
}

Finally to use it in your javascript code :

window.plugins.tts.setCallbackFct("yourcallbackFunction()");

Regards,
Guillaume Caplain

MapKitPlug Multiple Pin Points

I am using MapKitPlug and it works but I would like to add multiple to and from destinations on the map, is that possible? I would like to say pin1 is a "from" address and pin2 is a "to" address at the same time I would like to put pin3 as a "from" address and pin4 as a "to" address. Is it really possible?

Please give an example.

GAPSocket: Should not call readDataToData twice

I had a weird bug where I would always get a (null) error message after sending data, reading the response, and closing the socket on the server side.
After some research, it turns out the socket was still waiting for data.
Commenting the following line of code fix the issue:
[sock readDataToData:[AsyncSocket CRLFData] withTimeout:-1 tag:0]; (l.195 GAPSocketCommand.m)
The thing is that it reads on connect, and the server I connect to don't send anything on connect, it only returns data when I send something.

Note that this is not a proper fix (but it's enough for me), since you won't receive any data unless you send some.
I think the way to go should be to have a flag set to true in the didReadData delegate method, and only if this flag is set to true call the readDataToData method in the send method of GAPSocketCommand.m.

I don't have time to do that right now, and won't have time until a while. Just thought I'd at least share this issue and a way to maybe fix it.

Childbrowser no longer works for local files on iOS.

Since upgrading to xCode 4.2, phonegap 1.2.0, iOS 5 (which I did all a flurry in one day), I can no longer use childbrowser with local files in the www folder. Works fine with http://, https://, just not local filesystem.

How do I get the barcode scanner working in phonegap 1.7.0?

I tried to get the barcode scanning plugin working using the example included but the version of phonegap is out of date. I have tried running it on 1.7.0 but it seems the plugin itself doesn't exist. What do you need to do to get it working with 1.7.0?

Android VideoPlayer plugin does not work

I've tried to use Android VideoPlayer plugin and it doesn't work.
It raises runtime exception at VideoPlayer.java=>playVideo method.

Failed at this.ctx.startActivity(intent).
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=android.resource://com.xxxxx.yyyyyyy/2130968576 typ=video/* }

Regards
Peter

Android/FileUploader Cookie Issue

=>InputStream is = conn.getInputStream();
throws FileNotFoundException.
if there is no cookie exists.

I add a condition can fix this problem.
=>if(cookie!=null) conn.setRequestProperty("Cookie", cookie);

:)

PayPal Plugin has non public selector (instance) issue.

Hi.
I made a phonegap iPhone app with Phonegap PayPalPlugin(SAiOSPaypalPlugin) and tried to upload into iTunes appstore using AppLoader.
But AppLoader said "The app references non-public selectors in [AppName.app]/[AppName]:instance".
How can I solve this non-public selector issue?
Without this paypal plugin, I can upload app to Appstore without any issues.
Who can help me to solve this issue?
Thanks.

AudioRecord is not working in 1.7.0

hi!
If run in 1.7.0, error message is shown

[INFO] Error in success callback: File2 = TypeError: 'undefined' is not a function

how to solve this problem?

peace.

SoundPlug plugin

Has anyone had any success integrating the SoundPlug plugin into a Phonegap 1.3.0 project? I'm getting casting errors in Soundplug.m line 22:

AudioServicesCreateSystemSoundID((CFURLRef)fileURL, &soundID);

I'm not an ObjC programmer so I don't really know how to properly debug this.

ChildBrowser and PhoneGap 1.3.0

I have recently upgraded phonegap to the latest build, 1.3.0. With this upgrade ChildBrowser has stopped functioning. Is there a solution for 1.3.0?

How to create new Plugin directory?

I am new to Git but have been using PhoneGap for some time. I found a need to add a plugin into it but am new to IPhone development too. I have written the plugin but it's not working as it should be so I though I should create a directory here for my plugin and some one could contribute it with me.

Any link to guide or your own short guide would be really helpful.

barcode scanner does not work 1.7.0

Trying to get the example zip file inside barcode working, but when I run it on my iPhone 4 running 5.1.1 it seems not to run, when I hit the scan something, it does not launch the scanner to scan the barcode. please help

Childbrowser to load more then two url in android?

I need to load more two web page url in childbrowser and then go to next prevoius function to view web page in childbrowser. Iphone this function is working fine but android to load only one url.if it possible in android?

BarcodeScanner throwing undefined error in Cordova 1.7.0

Hi!

I am using iOS BarcodeScanner with 1.7.0
https://github.com/purplecabbage/phonegap-plugins/tree/master/iOS/B...

I have followed the instructions completely but when running the tests I get the following error
BarcodeScanner failure: exception scanning: TypeError: 'undefined' is not an object

All I have done is run "make build" in the test directory, copied those files over to www, changed the 1.5.0 to 1.7.0 and ran it

The barcode photos load in fine but when hitting the scan button the above error is shown in read in Results: and in the console

I have tried the following proposed solution, but to no avail, still the same error
http://stackoverflow.com/questions/10450259/ios-phonegap-1-7-0-barc...

Peace.
Pat

EMailComposer works on the iphone emulator but not on the device

Dear Jesse,
I hope I am putting this comment in the right place, if not, please let me know where you'd like to see problem report.
I have finally understood how to use your fantastic EMailComposer and jumped from my seat when I saw the composer slide up on my Iphone Simulator, I immediately tried to compile the project for my iphone device but when clicking on the button supposed to bring up the composer nothing happen. I can see the button being depressed, there are no visible errors but the composer does not show up.
I tried running this looking at the iphone console in Debug mode, same story, no errors.

The iphone I am using is a 3GS with IOS 4.02
I have a little function called when clicking a link, it is executed because I inserted an alert to make sure it was.
function sendEmail() {
alert('In sendEmail');
window.plugins.emailComposer.showEmailComposer("Test subject","Body","[email protected]","","");
}
I have added UIkit.Framework and have added the .h and .m in the plugins folder.

Any idea what I could be doing wrong ?

Thanks in advance.
Raymond Othenin-Girard.

Childbrowser not closing and focus issues.

I'm working on this app on Android. The user can select a link and this link opens the child browser. If the user presses the Android back button and selects a new link, a new instance of the child browser is opened. But the previous instance of the child browser is the one that has focus. To get to the new instance, I have to close out the old one by hitting the close button. After doing that, the close button no longer works and the new instance of the child browser can't be closed.
Is there anyway to have all links open in the same instance of the childbrowser?

GapSocket: Doesn't trigger didReadData with \0

When data is send from a server to the client which is using GapSocket, then GapSocket doesn't trigger the didReadData method when the string is null-terminated (or zero-terminated). It only seems to work when the string is \r\n terminated.

Malformed POST request in iPhone/FileUploader plugin

I'm having trouble using the FileUploader plugin with a node.js server using the formidable form parser. The uploaded file is in fact been saved on the server, but then it will crash when trying to parse the request.

I used Wireshark to look at how the request was been sent and it says it's a malformed packet:

Frame 28: 1451 bytes on wire (11608 bits), 1451 bytes captured (11608 bits)

Hypertext Transfer Protocol
    POST /api/files?touch=1302988010277&type=image HTTP/1.1\r\n
        [Expert Info (Chat/Sequence): POST /api/files?touch=1302988010277&type=image HTTP/1.1\r\n]
            [Message: POST /api/files?touch=1302988010277&type=image HTTP/1.1\r\n]
            [Severity level: Chat]
            [Group: Sequence]
        Request Method: POST
        Request URI: /api/files?touch=1302988010277&type=image
        Request Version: HTTP/1.1
    Host: example.com\r\n
    Content-Type: multipart/form-data; boundary=*****com.beetight.formBoundary\r\n
    X-Requested-With: XMLHttpRequest\r\n
    User-Agent: Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8C134\r\n
    Accept: */*\r\n
    Accept-Language: en-us\r\n
    Accept-Encoding: gzip, deflate\r\n
    Content-Length: 7177\r\n
        [Content length: 7177]
    Connection: keep-alive\r\n
    \r\n
    [Full request URI: http://example.com/api/files?touch=1302988010277&type=image]
MIME Multipart Media Encapsulation, Type: multipart/form-data, Boundary: "*****com.beetight.formBoundary"
    [Type: multipart/form-data]
    First boundary: --*****com.beetight.formBoundary\r\n
    Encapsulated multipart part:  ()
        Content-Disposition: form-data; name=""; filename=""\r\n
        Content-Type: \r\n\r\n
        Media Type
            Media Type:  (7035 bytes)
    Boundary: \r\n--*****com.beetight.formBoundary\r\n
    Encapsulated multipart part: 
[Malformed Packet: MIME multipart]
    [Expert Info (Error/Malformed): Malformed Packet (Exception occurred)]
        [Message: Malformed Packet (Exception occurred)]
        [Severity level: Error]
        [Group: Malformed]

Replace deprecated methods in Childbrowser plugin for iOS

'PhoneGapViewController' is deprecated but used in the ChildBrowserCommand class:

  • (void) showWebPage:(NSMutableArray_)arguments withDict:(NSMutableDictionary_)options // args: url

......

PhoneGapViewController* cont = (PhoneGapViewController*)[ super appViewController ];

.....

ChildBrowser: Cant get button bar to show

hey everyone.
i managed to install Childbrowser with Xcode 4.2.1 and phone gap 1.4.1 i get in app browsing to all the links i need.
my only problem is that i can't go back to my app i don't have the button bar at all no "Done" or anything else.
i have to quit the app and open it again.
if anyone have any idea plz help.
Thanks!

Barcode Scanner: android plugin should support static linking to a library like the iphone version

I find the iphone version cleaner to use as an app developer that's integrating the zxing/purplecabbage library. The user runs my app, starts a barcode scan, and it all just works. The android version requires the user to install the Barcode Scanner application which is ok, but not quite perfect. Would be nice to have iphone-equivalent functionality.

Protocol-wise, not sure if it is better to ask the question on the phonegap google group before creating an issue. Please let me know if an email posting would have been better.

Thanks,
Anand

Black screen on url load (ios)

Hi,

I've tried to install childbrowser on an empty cordova project (latest build) and I get a black screen when I try to load a url (any url).
I'm using the code from the example PhoneGap.exec("ChildBrowserCommand.showWebPage", "http://www.google.com" );
and getting no errors from xcode

NativeControls crashes when calling selectTabBarItem without String argument

Hey,

I just upgraded to Phonegap 1.3.0 (from 1.0.0) and encountered the following error: When you call the selectTabBarItem method with no argument (or with null argument), it throws an out of bounds error. I suspect this to happen in line 300 of NativeControls.m when objectAtIndex is called.

This is not a big deal, since it works when you call the method with an empty string ''. However, you might consider editing the description of the function in both the .m and the .js file, since it tells you to call the method with nil.

Best wishes
Alexander Körschgen

ChildBrowserCommand (pluginName: ChildBrowserCommand) does not exist

I am trying to use ChildBrowserPlugin of phonegap 1.0.0 and X-Code 4.

but it gives error. Even I have added
key : ChildBrowserCommand
string : ChildBrowserCommand
in PhoneGap.plist

2011-10-03 16:17:06.530 samplePlugins[3913:40b] PGPlugin class ChildBrowserCommand (pluginName: ChildBrowserCommand) does not exist.
2011-10-03 16:17:06.531 samplePlugins[3913:40b] ERROR: Plugin 'ChildBrowserCommand' not found, or is not a PGPlugin. Check your plugin mapping in PhoneGap.plist.

Can anyone help me whats is wrong with my setting or code.

I put the ChildBrowser.js in www folder
index.html

< script type="text/javascript" charset="utf-8" src="ChildBrowser.js" >< / script >

            function onDeviceReady()
            {
                var cb = ChildBrowser.install();
                if(cb != null)
                {
                    cb.onLocationChange = function(loc){ root.locChanged(loc); };
                    cb.onClose = function(){root.onCloseBrowser()};
                    cb.onOpenExternal = function(){root.onOpenExternal();};
                    window.plugins.childBrowser.showWebPage("http://google.com");
                }
            }

            function onLocationChange(loc) {
                navigator.notification.alert('Change to URL : '+loc);
            }
            function onClose() {
                navigator.notification.alert('onClose :');
            }
            function onOpenExternal() {
                navigator.notification.alert('onOpenExternal :');
            }

Use common filename for childbrowser.js file

There is a "childbrowser.js" for android, and a "ChildBrowser.js" for iphone. Can you rename one of these files so that they each use the same name.

This way, our html file doesn't have to change between iphone/android....

Thanks.

SMSComposer - SMS Text not available

Sorry I'am newbie to develop on phoneGap.
I follow the tutorial of SMSComposer with this:

window.plugins.smsComposer.showSMSComposer('3424221122','hello');

When I cliked on link which run this javascript command on the Simulator iPhone 4.3 iOS it's say "SMS Text not available" alert.

It's broken plugin or I'm doing some mistake?

Please let me now....

Multiple file upload with fileuploader

Hi,

Can I upload multiple file using the fileuploader plugin for iphone.

I am able to upload single file using the fileuploader...now i need to upload 2 files to the server.

How can I carry out this?

Any guide would be really helpful.

Thanks

About Share plugin for Android Phonegap 1.0

  1. copy Share.java to com\schaul\plugins\share

  2. edit plugins.xml

  3. edit main app.java, import com.schaul.plugins.share.Share;

  4. edit index.html,but it can’t working, ex:

    $(“button”).click(function(){

    window.plugins.share.show({

    subject: ‘I like turtles’,

    text: ‘http://www.mndaily.com'},

    function() {alert(“OK”)}, // Success function

    function() {alert(‘Share failed’)} // Failure function

    );

    })

the Logcat log show “TypeError: Result of expression ‘window.plugins.share’ [undefined] is not an object”

so what can i do ?

update childbrowser plugin to open local files like images and pdf files in both android and iphone

Hi I am trying to open local pdf file in childbrowser in android. i copied one image in /mnt/sdcard/some_folder/some_image .png and /mnt/sdcard/some_folder/some_pdf . Now when i try to use window.plugins.childBrowser.showWebPage("/mnt/sdcard/some_folder/some_image.png") or window.plugins.childBrowser.showWebPage("/mnt/sdcard/some_folder/some_file.pdf") it always show that url not found.

i tried to comment

if (!url.startsWith("http")) {
this.webview.loadUrl("http://" + url);
}

and

if (url.startsWith("http:") || url.startsWith("https:")) {
newloc = url;
} else {
newloc = "http://" + url;
}
in childbrowser.java but could not get through i dont know java.
but no use.

while window.plugins.childBrowser.showWebPage("http://www.google.com",{showLocationBar:true}); opens successfully and even a remote image also opens successfully with

kindly help me with this
Thanks
dinesh

Lack of documentation

Any change that we could have a quick piece of documentation in the readme file so us PhoneGappers can find out how to use this plugin? And perhaps a small overview of the plugin's functionality.

Twitter iOS Plugin Crash

I've followed the directions and the twitter app only works once in a while on my app. Sometimes I have to wait 30 seconds for the twitter modal to instantiate the first time. I've set up the following tests:

                    window.plugins.twitter.isTwitterAvailable(function(r){
                            console.log("twitter available? " + r); // answer returns 1
                        });
                        window.plugins.twitter.isTwitterSetup(function(r){
                            console.log("twitter configured? " + r); // answer returns 1
                        }); 

From there, I get a bright blue lldb error.

Is there anything I can do to further debug?

Childbrowser open a about:blank

Hey Guys,

i have a App with follow features:

  • External Links
  • Internal Links

When i click on a internal link from a Button ("index.html", "test.thml",..) the childbrowser will open a about:blank page. External Links (Facebook,..) will open directly on Childbrowser.

If i click on the interal link, the childbrowser open on the first running by the app the about:blank page. This problem are only when the app running on first time.

internal links are handled with window.location.href...

Can u help me?

Childbrowser setup instructions

Looks like the Readme.txt no longer contains the installation instructions for the Childbrowser plugin. Think you all can put them back in?

Long delay using SMSComposer

I have a very simple app that calls the SMSComposer and it seems to work but there is a 10 second delay between calling the plugin and getting the SMS page up together with the error in the console "wait_fences: failed to receive reply: 10004003".

Has anyone else experienced this and have a fix or workround?

I am using iphone 3GS with IOS5.0, xcode 4.2

function onDeviceReady()
{
// do your thing!
navigator.notification.alert("PhoneGap is working")
}
function sendsms () {
console.log ("start sms");
window.plugins.smsComposer.showSMSComposer('01234567890', 'hello');
console.log ("loaded sms");
}
</script>

Hey, it's PhoneGap!

Send SMS

Childbrowser doesn't open from Barcodescanner in iOS

My first post ever, so sorry for the ignorance, and any feedback is hugely appreciated. i admit I'm a bit if a hack - haven't touched C in 25 years and this is my first web app.

I have both the scanner working and childbrowser working in the app. I can scan a QR code and open in Safari just fine, but can't scan into a childbrowser view. I get no errors at all in the device console - the window just doesn't open and the view returns to the page where the scan is launched. The function's shown below, and i also found a method of changing the native code to load all links in the childbrowser (which works great - but same problem --doesn't work with barcodescanner).

Been beating my head against a wall on this for nights now - thanks in advance!!!!

        //------------------------------------------------------------------------------
        var button
        var result
        var childBrowser

        //------------------------------------------------------------------------------
        function onLoad() {
            if (!window.PhoneGap) {
                alert("PhoneGap is not available")
                return
            }

            document.addEventListener("deviceready",onDeviceReady,false)

            button     = document.getElementById("scan-button")
            resultSpan = document.getElementById("scan-result")

        }

        //------------------------------------------------------------------------------
        function onDeviceReady() {
            button.addEventListener("click", onClick, false)
            document.addEventListener("offline", onOffline, false)
            childBrowser = ChildBrowser.install();
        }

        //------------------------------------------------------------------------------
        function onClick() {
            window.plugins.barcodeScanner.scan(scannerSuccess, scannerFailure)
        }

        //------------------------------------------------------------------------------
        function scannerSuccess(result) {
            console.log("scannerSuccess: result: " + JSON.stringify(result.text));
            resultSpan.innerText = (result.text);
             if (result.cancelled)
                  window.location.replace("index.html")
            else        
            window.plugins.childBrowser.showWebPage(result.text)
        }

        //------------------------------------------------------------------------------
        function scannerFailure(message) {
            console.log("scannerFailure: message: " + JSON.stringify(message))
        }

Android childbrowser setJavaScriptEnabled not working

When loading a local file in the childbrowser I noticed that javascript is disabled, although setJavaScriptEnabled is passed true in the java file. I was able to remedy this by adding

// added WebSettings
import android.webkit.WebSettings;

// replaced this
webview = new WebView(ctx);
webview.getSettings().setJavaScriptEnabled(true);

// with this
WebSettings settings = webview.getSettings();
settings.setJavaScriptEnabled(true);

Should webview.getSettings() work without importing WebSettings?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.