Phonegap activityStart in android not showing the messge which I pass - android

In my project I used navigator.notification.activitystart("Title","Message").
But it is just showing the title as "Busy" and message as "Please wait". I can stop the activity with navigator.notification.activityStop()
So i want to ask does the activityStart really shows the title and message on android phones.
I am using phonegap1.1.0
Thanks all in advance

From both phonegap-1.1.0.js and phonegap-1.3.0.js:
Notification.prototype.activityStart = function() {
PhoneGap.exec(null, null, "Notification", "activityStart", ["Busy","Please wait..."]);
};
Note that activityStart takes no parameters, so you'd have to modify it to actually accept your parameters.

Related

Problems with implementing OneSignal Corna SDK

I am trying to implement OneSignal Corna SDK for receiving PUSH NOTIFICATIONS,
But it is giving me a runtime error
stack traceback:
/Users/ojussave/Library/Application Support/Corona/Simulator/Plugins/plugin_OneSignal.lua:49: in function 'Init'
main.lua:52: in main chunk
This error means that there was likely a syntax error in your code. Make sure you have formatted the call to the OneSignal init method correctly, like so:
-- This function gets called when the user opens a notification or one is received when the app is open and active.
-- Change the code below to fit your apps needs.
function DidReceiveRemoteNotification(message, additionalData, isActive)
if (additionalData) then
if (additionalData.discount) then
native.showAlert( "Discount!", message, { "OK" } )
-- Take user to your app store
elseif (additionalData.actionSelected) then -- Interactive notification button pressed
native.showAlert("Button Pressed!", "ButtonID:" .. additionalData.actionSelected, { "OK"} )
end
else
native.showAlert("OneSignal Message", message, { "OK" } )
end
end
local OneSignal = require("plugin.OneSignal")
-- Uncomment SetLogLevel to debug issues.
-- OneSignal.SetLogLevel(4, 4)
OneSignal.Init("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "############", DidReceiveRemoteNotification)

how to send SMS or make a phone call from a samsung gear s app

i am trying to find a way to send SMS and make a phone call from a samsung gear s app.
the documentation is mostly missing and searching for this did not lead to much findings.
has anybody worked with that? is it at all possible?
as an alternative, if the app cannot send SMS or make the call, is it possible to start the default apps (similar to Android intent for SMS/Phone app or iOS openURL).
thanks.
#memical - I have found a workaround to launch message/sms app using the app id.
<p onclick="hackSMS();">Send SMS</p>
<script>
function hackSMS() {
tizen.application.launch("com.samsung.message", function(){console.log ("Launched")});
}
</script>
Remember to add this http://tizen.org/privilege/application.launch priviege in your apps config.xml
Note: I tried other methods also like using exposed tizen platform api's for web apps to launch some predefined app control. But it is working for Call and not for sms.
here is what i find so far:
to make a call from a Gear S app use the following code:
var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/call", "tel:001....");
tizen.application.launchAppControl(appControl, null,
function() {
console.log("ok");
},
function(e)
{
console.log("error: " + e.message);
},
{
onsuccess : function()
{
console.log("ok 2");
},
onfailure : function(er)
{
console.log("error 2: " + er.message);
}
});
sending SMS is not possible at this time.
There is no messaging API implemented on Tizen for wearable devices. You can check it yourself by calling:
console.log(tizen.messaging);
It will return 'undefined'
It means that you can't programmatically send or read an SMS or an email from your wearable device using Tizen messaging API.
To open the app for make a call try this code:
Uri number = Uri.parse("tel:"+telNumber);
Intent openCallIntent = new Intent(Intent.ACTION_DIAL, number);
startActivity(openCallIntent);
To make a call:
Uri number = Uri.parse("tel:"+telNumber);
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(number);
startActivity(callIntent);
To send an sms:
Intent sendSmsIntent = new Intent(Intent.ACTION_VIEW);
sendSmsIntent.setType("vnd.android-dir/mms-sms");
sendSmsIntent.putExtra("address", telNumber);
sendSmsIntent.putExtra("sms_body","Whatever you want");
startActivity(sendSmsIntent);
Similar questions to this one are already answered in stackoverflow
Try this which is very simple as compare to using the platform APIs.
http://www.w3.org/TR/mwabp/#bp-interaction-uri-schemes
The most broadly supported scheme is tel: as described in RFC3966
[RFC3966]. Code such as the following can be used to enable
"Click-to-Call":
[PHONE-NUMBER]
Note that [PHONE-NUMBER] should always be entered using the full
international prefix (e.g. +1-201-555-0111) to ensure that it works
outside of its home country.
Similarly RFC5724 [RFC5724] can be used to send a GSM SMS (text
message) as follows:
[PHONE-NUMBER]
Note that at the time of writing support for this RFC is limited and
device compatibility should be verified before deployment.

Cannot share custom text on facebook with cordova socialsharing plugin on android

I am building an app, using cordova, for android and iphone. I have this function to share some text on facebook:
window.plugins.socialsharing.canShareVia('com.facebook.katana', 'msg', null, null, null,
function () {
window.plugins.socialsharing.shareViaFacebook("Some custom text here" + link),
null,
null,
console.log('share ok'), // success callback
function (errormsg) {
alert(errormsg);
}); // error callback
},
function () {
console.log("NO FACEBOOK AVAILABLE");
navigator.notification.alert('The Facebook app is not available on your device.', // message
console.log('facebook app not installed'), // callback
'Share', // title
'Ok' // buttonName
);
});
In iphone is all working fine, i can share the text and the link on facebook thought the native app. In android, the facebook app will open but the custom text is missing, although the link do appear.
You can see the resulting post here: https://www.dropbox.com/s/bo0ughcv9w36zec/Screen_Shot.png
I have found some posts: https://developers.facebook.com/blog/post/510/ stating the custom message will be ignored, but I'm not sure this applies, besides in ios is working properly. Any help will be appreciated. Thank you.
It seems that Facebook does not allow, in their facebook app for android, to add custom text, we can only share a link. More info can be found here: https://developers.facebook.com/bugs/332619626816423

Error with PushPlugin when the App is in background

I'm trying to implement a push notification app created with Cordava 3.3 using this: https://github.com/phonegap-build/PushPlugin ; Basing me in this tutorial: www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql
But I have 2 basic problems the first is that the notification does not lead if the app is in background or is closed and the second is that the message reaches Undefined when the app is open in the foreground, could help, as far as I was reading may be due the format of the JSON response or parameters sent in the same.
Here is my code not take long:
https://github.com/jedidas/Push
I achieved a solution that is on file with the plugin "GCMIntentService.java" near line 80 is the next instruction
else {
extras.putBoolean("foreground", false);
// Send a notification if there is a message
if (extras.getString("message") != null && extras.getString("message").length() != 0) {
createNotification(context, extras);
}
}
discover you can change the "price" for what you want, for example change the "price" for "message" and everything was solved milagorsamente, explain:
we have this:
. 1 $ message = array ("deprive" => $ message);
and read when I read it as:
1. E.payload.message
gives us comes as undefined because payload.price.
In this sense, we have to file in the JAVA plugin
if (extras.getString ("message")! = null && extras.getString ("message"). length ()! = 0) {
                     createNotification (context, options);
                 }
if that does not run because it is coming as "price" instead of "message". everything is solved when I change the "price" of SEND_MESSAGE.PHP for "message." thus not even need to modify the JAVA.

Pushwoosh get Additional data - Custom data

I'm using Pushwoosh to send notification both under Android and iOS.
Now it's possible to send Custom data under the Additional data tab of the Send push web page.
So I put some like this
{"event" : "1234"}
on the Custom data field but I can't get this kind of data on the app.
This is what I get under Android
{
"title":"test 4",
"collapse_key":"do_not_collapse",
"from":"320152062216",
"onStart":true,
"foreground":false,
"p":"f"
}
This is what I get under iOS
{
aps = {
alert = "test 4";
sound = default;
};
p = f;
}
Is there anyone who has managed to make it work?
Thanks.
I think Stack might be not the best place for this, but custom data is available only on Premium accounts.

Categories

Resources