Search Unity

Call an alert box from Unity

Discussion in 'Android' started by robhuhn, Feb 14, 2011.

  1. robhuhn

    robhuhn

    Joined:
    Jun 21, 2009
    Posts:
    113
    Hi

    I would like to know if there is an implementation to call alert boxes from Unity (C#) or do I have to write a plugin for that?
     
  2. Wozik

    Wozik

    Joined:
    Apr 10, 2009
    Posts:
    662
    If you asking if Unity allows you to call native OS alert boxes, then the answer is - you'd need to call narive OS alert boxes using native OS functions.

    If you need just an alert box, try to do it with Unity GUI
     
  3. fil

    fil

    Joined:
    Jul 17, 2012
    Posts:
    11
    Alekxss likes this.
  4. DeveshPandey

    DeveshPandey

    Joined:
    Sep 30, 2012
    Posts:
    221
    chuck666 likes this.
  5. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    Now that's simple, check out this Free to use plugin It allows you to access native alerts in both iOS n Android platforms.

    Surely its too late to be useful for robhuhn. But can be informative to others :)
     
    Last edited: Mar 25, 2021
    Karabin likes this.
  6. fafase

    fafase

    Joined:
    Jul 3, 2012
    Posts:
    163
    @VoxelBusters

    Downloading the asset screwed something in my project:

    Error: System.ArgumentException: An element with the same key already exists in the dictionary.
    at System.Collections.Generic.Dictionary`2[System.String,System.String].Add (System.String key, System.String value) [0x00000] in <filename unknown>:0
    at us.UnityScriptCompilerFactory.FromCommandLineOptions (us.CommandLineOptions options) [0x00000] in <filename unknown>:0
    at us.UsModule.compile (us.CommandLineOptions options) [0x00000] in <filename unknown>:0
    at us.UsModule.runWithCommandLine (System.String[] commandLine) [0x00000] in <filename unknown>:0
    at us.UsModule.Main (System.String[] argv) [0x00000] in <filename unknown>:0

    Since the error does not open the faulty script, I have to remove the plugin for the time being. It also required a restart of Unity if that may help.

    Dunno if that is conflicting with something else or what could be.
     
  7. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    Hey @fafase,

    Sorry for the inconvenience caused. Please go through this discussion, it will help you rectify this issue. And please let us know incase if you still find this issue.

    Regards
    VB Team
     
  8. Imatorio

    Imatorio

    Joined:
    Oct 27, 2016
    Posts:
    3
    Unfortunately, nothing seems to work here. I’ve tried to make a plugin for iOs and Android, but it was really tedious. To those who want to create their own plugin - just don’t waste your time. It is much easily to spend few dollars for a plugin in Unity Store. For example, I bought Mobile Alert Dialog and it works like a charm. There are few other plugins in the store, maybe you can try them, especially free ones. However, I found them either not working or inconvenient to use.
     
  9. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    @Imatorio Would be great if you can review our plugin. Its pretty straight forward to use and cross platform.

    Cheers,
    VB Team
     
  10. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,875
  11. sschnoor

    sschnoor

    Joined:
    Mar 15, 2019
    Posts:
    1
    That namespace isnt operational outside of the editor (hence the name "EditorUtility"). It will run native but when you try to build and push to the Android, it will have a build error and wont even give you your .apk file.

    The error says "does not exist in current context". SOOO any alternatives for a newbie app maker? I just want a message to pop up if they sign in with credentials that are wrong!
     
    Deleted User likes this.
  12. puneetmahali

    puneetmahali

    Joined:
    Jan 21, 2021
    Posts:
    16
    Hi Guys, I need to display the native alert view using Swift and the Unity As A Library approach.
    Have someone any idea how to do that?
    Thanks in advance!
     
  13. setiagaurav

    setiagaurav

    Joined:
    May 16, 2019
    Posts:
    2