local notification control to user specified page - view

I am developing an IOS application with phonegap and need to set local notification for it
Once user click on "view" button need to transfer the apps control to user specified page other than "index.html"

Since PhoneGap doesn't include currently this functionality, I'll assume your are using the LocalNotification plugin from Greg Allen & Drew Dahlman.
If you notice when you make the call to register the notification: plugins.localNotification.add() there are 2 parameters: "background" and "foreground" that contain javascript code to run when the app gets notified (in your case because it was in the background and you hit the "View" button).
Now, instead of using "app.background()" as in the example, you could pass there a Javascript code that navigates to the page you want to (or place your code in the background() function of the "app" object by editing the plugin file init.js.
For this to work make sure you have the implementation of the method didReceiveLocalNotification that comes with the plugin in the their modified AppDelegate.m class.

Related

Binding updates to shell component pages delayed

So I have a Shell that has a home page and a settings page.
The settings page makes changes to a singleton service that the home's ViewModel is binded to (MVVM).
I have set up break points on the PropertyChangedEvents of elements on the Home page and they hit as soon as changes are made to the service's properties and their PropertyChanged is executed.
However, upon going back to the home page via the Shell, the page's UI only updates when the page is active and visible. This causes fields to flash when they change. But the breakpoints suggest that they should have updated before.
Is there a way to force refresh the UI before or are there any other alternatives?
For now I have made my view perform a Fade In animation so that changes to the ViewModel don't cause flashing.
Even I have a Xamarin Forms Shell app, and I also had the same issue, So what you can do is, Make the common properties Global as in make those properties in App.xaml.cs and mark them as static.
So when the User changes the property on settings change the App.PropertyName.
Then on the OnApearing method of homepage call a method on the ViewModel say LoadDataValues() and read the App.PropertyName and modify the UI as needed.
What this will do is just before the HomePage appears it will keep the UI of HomePage ready.
Let me know if you have further issues.

Change Sidedrawer content dynamically

I´m at that point on my app, where the user Logged in, receive the data from the server and now i need to make same changes. One of the changes is change the button that appears on my Sidedrawer saying Log In to Log Out and vice-versa when the user Logs Out...I could talk about other changes but i think the main thing is...
How do I access the Sidedrawer content in order to change/add buttons. I already entered the app-root.xml and made same testing adding the navigatingTo="onNavigatingTo" function and also in the .js file just to see if it responds, but it doesn´t...
How do i perform this?
You can show/hide your button via visibility, text binding or via a structural directive like *ngIf (if using Angular). For example, take a look here - I am showing/hiding a button based on whether the user is logged in or not (here is the related code-behind code).
The above example is using an Angular directive and can be applied only in Angular based applications, but with the same logic, you can substitute ****ngIf*** with visibility and achieve the same in TypeScript or plain JavaScript app.
The easiest way to do it is put the frame inside drawer content area, then navigate frame to another page.

Integrating Surveyjs with Nativescript + Angular

I am trying to merge surveyjs along with my NativeScript application. I have referred URL for merging the same with Angular application
From the Angular demo code given on website, we have to add event handler for Complete button where we can get the response from surveyjs. Is it possible to integrate similarly for Nativescript Mobile application? Here is the approach which i feel can be taken.
Display
Create a HTML as provided by SurveyJS with required CSS and JS
referenced and add them as a file in project.
Modify HTML once i get the survey question json back from server.
Show the HTML as part of WebView. This will take care of displaying
the survey on my Application.
Here are my challenges during Submission
As per the process given on SurveyJS, i need to add handler for
oncomplete which will get the result json for me. How can i add
handlers for Complete button click in my code? Also please note that
there is a possibility that there may be multiple surveys on a single
page.
Apart from Survey, there are other fields also on the page and user
will submit them all in one go by clicking submit button of the page.
Hence i am planning to hide Complete button provided by SurveyJS
page. This needs to be triggered via code. Can this be done?
If someone can give directions on whether this scenario can be handled in nativescript application with Angular,it would help immensely.
yes it can be done using nativescript-webview-interface plugin.
add jS code inside WebView to handle oncomplete event from surveyJS. and on that function call emit some event to native app. after that add nativescript code to listen for that event and get the JSON back.
inside webView JS function
var oWebViewInterface = window.nsWebViewInterface;
// emit event to native app
oWebViewInterface.emit('anyEvent', jsonData);
inside native App
oWebViewInterface.on('anyEvent', function(jsonData){
// perform action on event
});
for more details on this you can check plugin readme file https://github.com/shripalsoni04/nativescript-webview-interface

How can I open the app from the url of calendar like Blackberry travel?

I´m developing an app like Blackberry Travel. In Blackberry Travel, when add a flight, it adds in the calendar. In this event has 'Notes', where appears a url to load the app and see the flight.
I need doing the same, but only the load the app behavior. So, I have two question:
How can I open the app from the url? I saw this but, when I use the sample HttpFilterDemo, when I click in the url www.rim.com that I typed in an event of the calendar, never execute setRequestProperty method.
How can I show 'Open with Blackberry' when I click in the url ?
It´s done!
A perfect example in blackberry developer documentation

Delphi Chromium - how get data of Ajax call when a button/link is clicked

I'm using Delphi Chromium component in an application to show web pages from a Web Application.
In these pages I have buttons that fire selective Ajax calls to Web Server.
I need the following thing:
when one of these buttons is clicked, after notification of event to 'host application' I should want from this notification to get data of Ajax request (and response too, if possible...) to do some processing on them from 'host application'.
Is it possible ?
The extension (the TCefv8HandlerOwn class) is in fact just a JavaScript function which fires the TCefv8HandlerOwn.Execute (where you can get or set its parameters) when it's called from somewhere in the script.

Resources