- This topic has 10 replies, 5 voices, and was last updated 10 years, 8 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)
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.
RaymondSchneiderMemberHi
I copy the the script to a new button but still the same url adress appers.
Sorry if I dont understand…
support-octavioMemberHi Rayan,
Could you tell me where you are testing it?
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
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.
RaymondSchneiderMemberHi
Thank you for the reply, well than i have to go native then I supose.
Do you recomend that?Regards
Ray
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() )
MalakSadikParticipantso if i used phoneui.alert the url will not be displayed after building the ios app?
BrandonMember@angelsprincess1
Thats correct, it will not work on web apps, but native apps should show a better alert without the URL.
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