I am opening registration screen from login screen as follows.
Now in the registration screen, i am trying to trigger alert message - rmq.app.alert("test alert") but I get this error message:"attempt to open UIAlertController on LoginScreen whose view is not in window hierarchy.
When I just open the registration screen as open RegistrationScreen.new(nav_bar: true, title: "") then the alert message pops up, but crashes on calling the screen close method. How can I make the alert message work with the above code.
Related
I'm creating an add-in on Outlook on the Web, and I'm seeing unexpected behavior when I test it.
In the Web version of Outlook, when I compose a message on the compose screen and click the "Send" button
A dialog box should appear, but it does not. Also, I am unable to send the email.
1)The event occurs even when the sample code described in the official reference is executed.
var dialog; Office.context.ui.displayDialogAsync('https://localhost:3000/index.html',
{height: 30, width: 20, displayInIframe: true},
function (asyncResult) { dialog = asyncResult.value; dialog.addEventHandler(
Office.EventType.DialogMessageReceived, processMessage); }
);[enter image description here][1]
2)The same behavior occurs when the sample code in (1) is incorporated into the official sample project files available on github.
â– sample code link
https://github.com/OfficeDev/Outlook-Add-in-On-Send
3)When the event occurs, don't go to connect to the URL that is given as an argument in displayDialogAsync.
4)The problem definitely occurs when I access Outlook on the web and immediately click "New Message" to go to the compose screen.
5)No error message is displayed when a problem occurs.
How can I open a notification in Xamarin. Forms?, I have implemented that receives and shows the notifications even if it is inside the application but I lack the action of the notification, not that to do...
I think you want to fire an action when user clicks your "OK" button on your message which includes notification message. I suggest you to use a custom dialog project like this:
Acr.UserDialogs
When you import that library, u can call a message and give an action method to its interface: (code may not compile, i wrote it randomly)
UserDialogs.Instance.Alert(new AlertConfig
{
Message = "Your notification message",
OkText = "OK",
OnAction = ()=>{/*youraction*/}
});
So when user taps on "OK" your action code will run. Do not forget to use "Device.BeginInvokeOnMainThread" method if you make UI changes:)
I'm trying to get my app to re-open to a 'home' view of sorts, after the user backs out of the app to the device screen. The intent is to keep them from going back to the login screen once they have logged in (when, say, they just start backing out of the app), and launching the 'home' (logged in) view when they re-open the app after backing out of it.
When the app starts, it sends the user to a 'loading' view, where the app checks auth status. Once status is obtained, it transfers them to either a 'login' view or a 'logged in' view. Once a user logs in, I don't want them to be able to go back to the login view, or the 'loading' view, so I implemented clearHistory when navigating from the 'loading' or the 'login' view to the 'logged in' view.
The problem, is when I tap the device back button while in the 'logged in' view, it will back out of the app to the device as intended. However, when I open the app back up from either the app icon or the 'recent screens' (android), it will open the app again, but displays the 'loading' view. Only this time it will not actually do anything, which isn't really the issue. Again it's the fact that this view is showing in the first place.
Here's my 'loading' view navigation code:
var frameModule = require("ui/frame");
var home_navigation = {
moduleName: "views/home/home",
clearHistory: true
};
if(logged){
var topmost = frameModule.topmost();
topmost.navigate(home_navigation);
}
else {
var topmost = frameModule.topmost();
topmost.navigate(splash_navigation);
}
For the login page, clearHistory is also used when navigating to the home page on login.
From my understanding, the entire history should clear upon navigating, leaving the view navigated to as the only history entry. So when a user taps back, it should go directly from that last view (home) to the device screen (which it does), and open that view when the user re-opens the app (which it doesn't). Any advice here?
Here's what I do:
On your app.ts (or .js) you need some way to check if the user has been auth'd prior to calling the application.start().
When a user logs into your app, store some key indicating this using the application-settings module.
import * as appSettings from 'application-settings';
let yourKey = 'whatever';
appSettings.setString('userAuthed', yourKey);
On the app.ts (.js) file
import * as app from 'application';
import * as appSettings from 'application-settings'
let userAuthed = appSettings.getString('userAuthed');
let x = JSON.parse(userAuthed) /// assuming you stringify some object and store it
if (x.name && x.isValid) {
app.start(''' your main page ''')
} else {
app.start(''' login page ''');
}
In our app we are displaying Notifications in alert style.
Displaying notification is working fine and we also get callback when user interacts with the notification either by clicking on notification or by clicking on Action button.
But the Alert Notification Pop up stay on the screen instead of going away even after user has dismissed it by clicking on the content of the notification.It goes away only after clicking close button.Pop up stay on the screen where as notification get cleared from notification center.
Is there is any solution to dismiss pop up when user click the content of alert notification.
You'll need to handle this manually. Implement the delegate method -userNotificationCenter:didActivateNotification: like this:
- (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
{
if (notification.activationType == NSUserNotificationActivationTypeContentsClicked) {
[center removeDeliveredNotification:notification];
}
}
I'm extending Appirater (a stand alone class that presents an UIAlertView to the user to solicit a rating for your app) by adding a single button that when selected will dismiss the alert, and bring up MFMailComposerViewController so the user can email feedback.
My implementation was/is to post a notification in Appirater, and then using [self presentModalViewController: vc animated: YES] from a viewController that listens for the notification. That viewController is the super class of all my main viewControllers.
It works in one of the main viewControllers is up, but crash's from within other viewControllers are the current viewController and I see the following warning in the console:
2010-12-17 11:27:59.632
Wine.com[18514:207] * Terminating
app due to uncaught exception
'NSInternalInconsistencyException',
reason: 'Attempting to begin a modal
transition from to
while a transition is
already in progress. Wait for
viewDidAppear/viewDidDisappear to know
the current transition has completed'
I tried delaying the sending of the notification from Appirater, but that does not seem to help.
Ideas/pointers?
I had a similar error when clicking on a UIButton to open a Modal View. I changed the UIButton's listener from UIControlEventAllEvents to UIControlEventTouchUpInside. Basically, it was firing the Modal View on Touch Down Inside and then trying to create another instance of the Modal View on Touch Up Inside.
The problem was that by implementing this in a superclass, I needed to make sure only the currently active viewController was processing the notification, not ALL 5 of them.