I use this module on my project.
I have three Ti.Ui.Switch on a screen. If I checked them all and press button, I should share (same text and image) via Facebook and Twitter. The most important thing, user should have possibility to post this text and image without confirmation popup.
If I try Social.twitter(for example), after click on button, user must confirm post again... How can i circumvent this feature?
How i can do this?
sharePhotoButton.addEventListener('click', function(e){
fbShare();
twShare();
emailShare();
});
function fbShare(){
if(fbSwitch.value){
if(Social.isFacebookSupported()){
Social.facebook({
text: commentArea.value,
image: event.media
});
}
}
};
function twShare(){
if(twSwitch.value){
if(Social.isTwitterSupported()){
Social.twitter({
text: commentArea.value,
image: event.media
});
}
}
};
function emailShare(){
if(emailSwitch.value){
var emailDialog = Ti.UI.createEmailDialog();
if(emailDialog.isSupported()){
emailDialog.messageBody = commentArea.value;
emailDialog.open();
}
}
};
Related
InAppBrowser missing the "Done" button that returns user to the app when using on iPhone. It is getting getting stuck on the webpage.
.directive("navigateTo", function($ionicGesture){
return{
restrict: 'A',
link:function($scope,$element,$attr) {
var tapHandler = function(e) {
var inAppBrowser = window.open(encodeURI($attr.navigateTo),'_blank','location=no', 'toolbar=yes');
};
var tapGesture =$ionicGesture.on('tap', tapHandler, $element);
$scope.on('$destroy', function(){
$ionicGesture.off(tapGesture, 'tap', tapHandler);
});
}
}
})
This is all the code for InAppBrowser. I call the navigateTo from one of the views in my app to open a link to a webpage.
I am using Meteor Framework.
The following code
123-456-7890
or
(123) 456-7890
Initiates a call automatically in iOS.
I need some kind of warning.. such as pop up saying
Call 123-456-7890 ?
and if the user wants to call then they can press Call or else Cancel.
How do I fix this on iOS?
You have two options.
First, you could wrap the call link inside a pop up or modal. In your template:
<a class="open-popup">Call 123-456-7890</a>
Open the pop up via click event. In Meteor you can do this like this:
Template.myTemplateName.events({
"click a.open-popup": function(event) {
// Open pop up ...
});
In this pop up you place the link 123-456-7890 alongside with a cancle button, which is nothing else than a pop up closer. <a class="close-popup">cancle</a>
Second, use a click event with confirm() function and then do a url redirect to the `tel://ยด address.
Template.myTemplateName.events({
"click a.open-popup": function(event) {
var r = confirm("Call 123-456-7890 ?");
if (r == true) {
let phoneNumber = "123-456-7890";
window.location.href="tel://"+phoneNumber;
} else {
// closes
}
});
I guess, the second option is easier to implement and already does, what you are looking for.
I'm trying to develop a webapp for iOS using the Parse-SDK.
When I save my app to the homescreen and press the button to login via facebook, it shows just a white screen.
I know this was asked several times, and a solution for the standard facebook-sdk is to add display : 'touch' to the FB.login-function.
But with parse-sdk I have to use this function:
window.fbAsyncInit = function() {
Parse.FacebookUtils.init({ // this line replaces FB.init({
appId : 'APP_ID', // Facebook App ID
status : true, // check Facebook Login status
cookie : true, // enable cookies to allow Parse to access the session
xfbml : true, // initialize Facebook social plugins on the page
version : 'v2.3' // point to the latest Facebook Graph API version
});
$('body').on('click', '#facebookLogin', function() {
Parse.FacebookUtils.logIn("email", {
success: function(user) {
alert("SUCCESS");
},
error: function(user, error) {
alert("User cancelled the Facebook login or did not fully authorize.");
}
});
});
};
So I can't add the option display : 'touch'. Does anyone know how to fix the white screen?
Thanks.
Is there any way to handle back button (device backbutton) as default functionality to move back page? I need to implement the same functionality on back button goes to previous page. If there is no previous page (first page) it exit the application. Is this possible in PhoneGap?
I also need to pop page before going to push another page is this posible in jQuery?
Checking window.location.length would be the easiest way to determine if you're on the first page, but this isn't available in Phonegap.
But since you're using JQM, you can either use the navigate event as Omar suggests or could manually count the number of pages shown and the number of pages gone back (same thing) and use this to determine if the first page is being shown and whether to exit the app. Something like this would work:
var pageHistoryCount = 0;
var goingBack = false;
$(document).bind("pageshow", function(e, data) {
if (goingBack) {
goingBack = false;
} else {
pageHistoryCount++;
console.log("Showing page #"+pageHistoryCount);
}
});
function exitApp() {
console.log("Exiting app");
navigator.app.exitApp();
}
function onPressBack(e) {
e.preventDefault();
if(pageHistoryCount > 0) pageHistoryCount--;
if (pageHistoryCount == 0) {
navigator.notification.confirm("Are you sure you want to quit?", function(result){
if(result == 2){
exitApp();
}else{
pageHistoryCount++;
}
}, 'Quit My App', 'Cancel,Ok');
} else {
goingBack = true;
console.log("Going back to page #"+pageHistoryCount);
window.history.back();
}
}
function deviceready() {
$(document).bind('backbutton', onPressBack);
}
$(document).bind('deviceready', deviceready);
As for the second part of your question:
Secondly i need to pop page before going to push another page is this
posible in jquery ?
It's not clear what you're asking here. Do you mean you want to show some kind of popup content like a dialog between every page change? Please clarify then I can help you :-)
I am using jquery.blockUI.js to show a popup for mobile application. Popup is shown when I click on button. But when I try to hide that popup on clicking outside that popup then it does not hide.
I am using this code to hide popup:-
jQuery('.blockOverlay').attr('title','Click to unblock').click(jQuery.unblockUI);
It works perfectly in desktop version of magento but Doesn't work for mobile theme.
Please help me how to solve this problem.
Try something like this..
function togglePopup(){
var selector = '#popup',
$popup = $(selector),
callback = function(e) {
if (!$(e.target).parents().andSelf().is(selector)) {
$popup.hide();
$(document).off('click', callback);
}
};
$popup.toggle();
if ($popup.is(':visible')) {
$(document).on('click', callback);
}
return false;
}