- This topic has 10 replies, 5 voices, and was last updated 11 years, 4 months ago by
Paul_paul.
-
AuthorPosts
-
RaymondSchneiderMemberHi
Howe do i make this happen in an easy way? Why cant you just remove the Url-adress within your popup alert in Mobione design center?
RegardsAlert Message without URL
From Octavio on the Forum regarding Alert Messages:
Following are 2 phoneui.js api that can be used in apps and webapps. The app context using the phonegap notification api which does not include the app URL. When used in a webapp the implementation falls back to standard javascript alert() and confirm() dialogs with the app url. In the jsdoc ‘TC’ refers to Test Center.
Code:
/**
* shows alert and calls fnContinue then. Note: works in different
* ways in iOS and TC. For TC it returns immediately, while for iOS
* it returns only when user pressed OK
*
* @param message Text message
* @param fnContinue function that called when user selected button.
* @param optionalTitle optional, title for dialog
* @param optionalButtonLabel optional, button label
*/
phoneui.alert(message, fnContinue, optionalTitle, optionalButtonLabel)/**
* shows confirmation dialog. result comes to fnContinue. Blocks in web app, doesn’t block in
* phonegap apps
*
* @param message Text message
* @param fnContinue function that called when user selected button. Takes 1-based index of selected button
* @param optionalTitle optional, title for dialog
* @param optionalButtonLabel optional, string with comma-separated button labels
*/
phoneui.confirm(message, fnContinue, optionalTitle, optionalButtonLabel)January 9, 2014 at 5:26 pm #345893
support-octavioMemberHi Rayan,
Attached a sample file that contains two buttons that calls a standar alert and the custom alert which doesn’t show the url on title, pushing second button you should get this result:
See attachment phoneuialert.pngAttachments:
You must be logged in to view attached files.January 10, 2014 at 8:25 am #345913
RaymondSchneiderMemberHi
I copy the the script to a new button but still the same url adress appers.
Sorry if I dont understand…
January 10, 2014 at 10:10 am #345916
support-octavioMemberHi Rayan,
Could you tell me where you are testing it?
January 10, 2014 at 10:40 am #345918
RaymondSchneiderMemberHi
I published the app, and there was the url again, perhapes I’m doing it wrong!
If I understand you correctly I can use the script from one of the attached buttons no?Ray
January 10, 2014 at 11:49 am #345921
support-octavioMemberHi Rayan,
The problem is that you are testing a web app, note the comment before describing the functions:
When used in a webapp the implementation falls back to standard javascript alert() and confirm() dialogs with the app url.
So that you only can use phoneui.alert() in native apps.
January 10, 2014 at 12:59 pm #345922
RaymondSchneiderMemberHi
Thank you for the reply, well than i have to go native then I supose.
Do you recomend that?Regards
RayJanuary 13, 2014 at 3:32 pm #345974
support-octavioMemberHi Rayan,
The document URL depicted in the native javascript alert() can not be avoided in webapps, only in native apps. If your target deployment is a mobile website then you may consider using a 3rd party dialog instead of any of the javascript notification apis (e.g., alert(), confirm(), prompt() )
February 21, 2014 at 4:45 am #347410
MalakSadikParticipantso if i used phoneui.alert the url will not be displayed after building the ios app?
February 21, 2014 at 7:47 am #347418
BrandonMember@angelsprincess1
Thats correct, it will not work on web apps, but native apps should show a better alert without the URL.February 23, 2014 at 10:02 pm #347467
Paul_paulParticipantMore to the point how can I remove the “Alert” from the “Alert Message”? I would like it to say something else …. ‘Danger! Danger!’ maybe.
-
AuthorPosts