Search code examples
iosrubymotion

UIAlert not working under UIWebView


If my app is in the background, i can receive the notification alert.

But if my app is in the foreground and focus on the UIWebView the alert window won't show content

any idea? Thanks so much

def application(application, didReceiveRemoteNotification: user_info)  
  alert_log(user_info[:some_extra_data])
end    

def alert_log(message)
alert = UIAlertView.new 
alert.message = message
alert.delegate = self
alert.show 
end 

As you can see the bg became grayed, and popup has no message. it can not be dismissed too

enter image description here


Solution

  • Use UIAlertController instead, UIAlertView was deprecated in iOS8, probably what’s causing your problem