Share contract - Deeplink UWP - share

I share an content of page, like image and text and it's work fine.
But i try ti share link for when someone click, navigate to a my UWP in a page of content shared before.
Like "Click here": this have a link to navigate for my app installed in uwp.
For navigate to my page I need to pass parameters, such as:
((App)(App.Current)).NavigationService.Navigate<MyPage>(Parameters.ToString());
I dont have any idea to do this. :(
someone help me please?
Thanks

If I understand you correctly; you want to supply a link which will open your UWP app and open a "previously shared" page.
To be able to do this you'll need to register to handle uri activation. You'll have to register a protocoll for your app, for example myawesomeapp:.
Then you can pass some additional parameters when someone click the link: myawsomeapp://navto=sharehistory&showitem=2.
Lastly your apps need to handle when it's launched from a uri in OnActivated:
protected override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.Protocol)
{
ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
// TODO: Handle URI activation
// The received URI is eventArgs.Uri.AbsoluteUri
}
}
You can read the docs here

Related

Ionic External link from email to application (Deep Linking)

I'm trying to add a link from email
that click on it will open the application in the relevant page.
I haven't found a solution for that yet.
If you do have any recommendation how to do that, i'll be glad to know.
Thanks.
This is the scenario :
user click forgot passowrd.
email is sent via server.
the email contains link for reset the password (this is what i need)
user click on the link an enter the reset password page on mobile application.
It's relevant to say that it should support All ionic platform (most important ios/ android)
I agree with #LiadLivnat in the past I used Custom-URL-scheme.
Here is a snippets of code:
Consider you have some run with reportAppLaunched method:
app.run(function($rootScope){
/* ... */
$rootScope.reportAppLaunched = function(url) {
$log.debug("App Launched Via Custom URL: " + url);
$rootScope.$apply(function() {
if (url.substring(0, 'mailto:'.length) === 'mailto:') {
$rootScope.navigateTo('forgot_password_view', {action: url});
}
});
};
}
Now this global function will be fired when, in my case, user opens contact list and clicks on some member. Android will ask with witch application you want to open this contact and you select . The method handleOpenURL is triggered and you can redirect to specific view in your application.
function handleOpenURL(url) {
var body = document.getElementsByTagName("body")[0];
var rootController = angular.element(body).scope();
rootController.reportAppLaunched(url);
}
Hope it will help,

How to redirect the user to a custom page when user click "Connect to QuickBooks" button?

So Intuit charges for each active connections to QuickBooks. Therefore, I want to restrict the QuickBooks functionality in my application to premium users only.
Ideally when any user clicks the "Connect to QuickBooks" button and my RequestOAuthToken http handler is called, I want to check if the user is allowed to use QuickBooks. If that is the case, then the normal OAuth flow continue. If the user is NOT allowed, then I want to redirect the user to the upgrade page of my app.
Given that the "Connect to QuickBooks" button opens a new window (at least on desktop, I haven't tried on phone/tablets), the window should get closed, and the main window (my app) should redirect the user to the right page. And actually this is exactly what happens if the normal OAuth flow completes.
Now, I have tried a few different approaches but I couldn't get it working.
1) In my RequestOAuthToken, return a HTTP redirect to the plan page
2) In my RequestOAuthToken, return an html page with javascript logic to redirect to page
3) In my RequestOAuthToken, return HTTP redirect to a page with javascript logic to redirect to page
4) I haven't tried that one but could I somehow intercept the javascript click handler on the Intuit button. I'm not sure if that is an accepted practice.
Here is the piece a javascript I grabbed from the .Net sample:
try
{
var parentlocation = window.parent.opener.location.hostname;
var currentlocation = window.location.hostname;
if (parentlocation != currentlocation)
{
window.location = plansUrl;
}
else
{
window.opener.location.href = window.opener.location.href;
window.close();
}
}
catch (e)
{
window.location = plansUrl;
}
Help me out please.
I don't think you'll be able to do exactly what you're asking, but you can probably come close by taking a different approach.
Rather than trying to redirect them after they click the button, why not try to redirect them before they click it? e.g. when they try to get to the page that has the "Connect to QuickBooks" button it, check if they are a premium user there, and redirect them if they are not.
I don't think you'll be able to redirect them after they click the button because once they click that button, they get kicked over to Intuit's website and it's beyond your control at that point.
Clement, Keith has provided the answer we would want you to pursue. You may not alter the behavior of the Connect To QuickBooks button. It must be used as described in our documentation. Providing a link to a page that shows the Connect To QuickBooks buttons for your premium users and an upgrade message to non-premium users is the way to go.
I highly recommend that you visit http://docs.developer.intuit.com/0025_Intuit_Anywhere/0010_Getting_Started/0040_Publishing_Your_App and review all of the documentation there. If you develop with our guidelines and requirements in mind it will speed up the review process.
Tony Purmal
Developer Relations Engineer
Intuit Partner Platform

Liferay : How to show a Configured Page once User Enters Valid Credentials

I am using Liferay 6.1 version .
Once a User enters http:localhost , i am displaying my Web Page called "/ravi" which consists of my Custom Portal as shown
I have configured this below properties under portal-ext.properties as shown
auth.forward.by.last.path=true
default.landing.page.path=/web/guest/ravi
Please see the screen shot of my Custom Portlet shown when the users enters http:localhost
Now my requirement is that i need to show another page ("/web/guest/test") if he enters valid crendentails .
In my processAction class , i am doing this way
public class ValidateUser extends MVCPortlet {
public void processAction(ActionRequest request, ActionResponse response) {
String userName = (String) request.getParameter("userName");
String password = (String) request.getParameter("password");
try {
// Contatcs DB and validates the credentials here
// Please let me know how can i show the Configured Page if his credentials are valid ??
}
catch (Exception e) {
}
}
}
Edited Part
Thank you very much for the answer with respect to the default login.events.post .
I am new to Liferay , so i may be doing a mistake here , so please help me if i was doing anything wrong .
I followed these steps :
Created a New Portlet named "MyLogon" Portlet and in its view.jsp created a form with two text fields (Login and Password ) and a submit button .
On click of that Submit Button , i was actually calling my processAction Method and making a DB call to validate Users from mysql db .
2.Then i created a page inside /web/guest/ravi and added this "MyLogon" Portlet to this new page /web/guest/ravi
Then configured this below properties under portal-ext.properties
auth.forward.by.last.path=true
default.landing.page.path=/web/guest/ravi
This is what i did .
And when entering http:localhost:8080 , it displayed taht page .
Please tell me if i am doing anything wrong
Edited 2nd Part
I have understood some part of your answer and i have these questions .
Could you please help
I need to validate Users based on the Data present inside my DataBase , so for this i need to do the below thins .
I need to create a Hook , to overdide this property
login.events.pre=com.LoginAction
public class LoginAction extends Action {
public void run(HttpServletRequest req, HttpServletResponse res) {
// Here i need to make a Database call to validate User Credentials and then do redirect him to the page i wanted ??
}
}
You need to create a Hook and override the default login.events.post
Below code for your reference,
public class LandingPageAction extends Action {
public LandingPageAction()
{
}
public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException
{
try
{
doRun(request, response);
}
catch(Exception e)
{
throw new ActionException(e);
}
}
protected void doRun(HttpServletRequest request, HttpServletResponse response) throws Exception
{
String homeRedirect="/web/guest/test";
LastPath lastPath = new LastPath(StringPool.BLANK, homeRedirect);
session.setAttribute("LAST_PATH", lastPath);
}
}
There are few things which I don't understand here. You are hitting localhost:8080, but screen shot shows that you are already logged in (there is a SignOut link and user Ravi Kiran is already logged in), but still there is a login page shown.
default.landing.page.path comes into picture when you are loggedin user. Are you hitting localhost:8080 or localhost/web/guest/Ravi ? You are not logged in yet, so it should not redirect to /web/guest/Ravi.
You could reuse the default Authentication code in Liferay. Not sure why you are taking User credentials from request parameters and making DB call yourself.
Edited as per the update in the question
1. The default Login Page of Liferay (the one that you see when you freshly download and hit localhost:8080 comes from this path
..\default\deploy\ROOT.war\html\portlet\login.
There is a login.jsp in this path which you can edit and give your own look and feel.
You can find below entry in this login.jsp page
<portlet:param name="struts_action" value="/login/login" />
This has a corresponding entry in ../deploy/ROOT.war/WEB-INF/struts-config.xml
<action path="/login/login" type="com.liferay.portlet.login.action.LoginAction">
<forward name="portlet.login.login" path="portlet.login.login" />
</action>
You can open up the source code and look into com.liferay.portlet.login.action.LoginAction method.
This performs a basic Authentication as per your passwords.encryption.algorithm= and passwords.digest.encoding=
configuration in portal-ext.properties file. LoginAction will perform basic authentication and will redirect all
users as per path mentioned in default.landing.page.path=
If you want (some) Users to redirect to (some) other path(conditionally), you can use the code I have mentioned above by writing a Hook.
2. Once authenticated, you can login and create a Page (in your case its "ravi"). You can add your custom Portlet to this Page. You should not write a cutom portlet which will do authentication once you are already logged in

Sending a file throught a Post with HTTPBuilder in Grails

I am developing a Facebook Application an i wanna send a video file from myServer to Facebbok User`s Timeline. This is the page with the explanation http://developers.facebook.com/blog/post/515/#video_upload but its a PHP code.
My app is on Grails, and im looking in HTTBuilder class but can't find a way to do this.
Do someone know how to do it?
If isnt possible to do this with HTTPBuilder, in my app, i am using Spring Social Facebook Plugin on Grais
I found the interface MediaOperations but i dont know how to use this interface and use the method postVideo to upload a Video.
Thanks!
Will try to help a bit. You may use MediaOperations interface for this operation. Spring Social Facebook Plugin configures a service called Facebook for you. You can use it via dependency injection.
Here is a simple code example:
import org.springframework.social.facebook.api.Facebook
class FacebookService {
Facebook facebook
def uploadVideo(String videoFileName, String title, String description) {
try {
def videoResource = new FileSystemResource(videoFileName)
facebook.mediaOperations().postVideo(videoResource, title, description)
return true
}
catch (Exception e) {
log.error("Error to upload video to facebook", e)
return false
}
}
}
The video is loaded from the file in the FS by specified file path/name from videoFileName variable. This means, user need to upload the video first, and code should save it to some file in FS first, then upload. Usually this is the best case, as video files are large. Maybe there is a sense to upload the video to facebook in separate thread and don't give the user to wait.

How to Add facebook "Install App Button" on a Fanpage Tab (Based on working example)

For some time now I try to figure out how these guys were able to add "Sign online here" button which is "install App" button on their fan-page tab:
http://www.facebook.com/GuinnessIreland?v=app_165491161181
I've read around the web and couldn't come up with any solid solution. The FBML and FBJS documentation left me with nothing.
So please, if anyone can help me with this.
NOTE: To make multiple tests on the Ajax request that are sent, do not accept the App install. It behaves differently after that.
I had some problems with finding out about it as well. There is no info about this kind of behavior in wiki or anywhere. I got it working after trying some possible solutions and the simplest one is to make user interact with content embedded in fan page tab such as click on something etc. Then you need to post an ajax request with requirelogin parameter to pop up to come out. The simple example would be:
user_ajax = function() {
var ajax = new Ajax();
ajax.responseType = Ajax.RAW;
ajax.requireLogin = true;
ajax.ondone = function(data) {
new Dialog(Dialog.DIALOG_POP).showMessage('Status', data, button_confirm = 'Okay');
}
var url = "http://yourappurl.com/request_handler"
ajax.post(url);
}
And the trigger for it:
Interaction
Then if user is known to be using your application (fan page tab) you can prompt him for additional permission like publish stream or email communication by calling:
Facebook.showPermissionDialog('publish_stream,email');
Hope this solves the problem.