GithubHelp home page GithubHelp logo

Comments (17)

mderazon avatar mderazon commented on June 1, 2024

Is it only on IOS 9 ? Haven't tested it on this version yet, there might have been some changes in Safari.

Can you try running the code in an earlier version in the simulator ?

from node-deeplink.

jaikumar-b avatar jaikumar-b commented on June 1, 2024

Getting the same error on iOS 8.4 as well

from node-deeplink.

mderazon avatar mderazon commented on June 1, 2024

deeplink already exposes a middleware, so there's no need to save it to a var before and execute it.
try doing

exports.deeplink = deeplink({
    fallback: 'http://' + req.headers.host,
    ios_store_link: 'https://itunes.apple.com/us/app/cups-unlimited-coffee/id556462755?mt=8&uo=4',
});

see example here
https://github.com/mderazon/node-deeplink/blob/master/example/app.js

from node-deeplink.

jaikumar-b avatar jaikumar-b commented on June 1, 2024

No luck with that either. Same error.

from node-deeplink.

jaikumar-b avatar jaikumar-b commented on June 1, 2024

Is there any way we can have a callback with the inline html and from the controller response, send the html to client?

from node-deeplink.

mderazon avatar mderazon commented on June 1, 2024

Can you show me the complete code of what you're trying to do ? I could try and reproduce it

Also you could try and debug it in the simulator, you'll have to hook Safari debugger to the simulator (done in Safari menu somewhere) and put a breakpoint on the js code that runs on that page

from node-deeplink.

jaikumar-b avatar jaikumar-b commented on June 1, 2024

I don't think the javascript is going to the mobile client. All I can see is standardError.html. in the Safari debugger.

I am using the mean js boilerplate code. After the reset password token validation, a function checks if the reset link was clicked by iPad or iPhone and redirects them to the mobile deeplink which makes a get request to the deeplinked URL in the core server route.

function(err, user) {
    var userAgent = req.headers['user-agent'];
    if (userAgent !== null && (userAgent.indexOf('iPhone') > -1 || userAgent.indexOf('iPad') > -1) {
        res.redirect('/deeplink?url=myapp%3A%2F%2Freset');
    } else {
      if (!user) {
            return res.redirect('/#!/password/reset/invalid');
        }
        res.redirect('/#!/password/reset/' + req.params.token);
    }

In my core server routes, there is wildcard route for deeplinks.

    // Deeplinking into apps
    app.route('/deeplink*').get(core.deeplink);

In the core server controller -

exports.deeplink = deeplink({
    fallback: 'http://localhost:3000',
    ios_store_link: 'https://itunes.apple.com/us/app/cups-unlimited-coffee/id556462755?mt=8&uo=4',
});
};

from node-deeplink.

mderazon avatar mderazon commented on June 1, 2024

If the page doesn't load then my guess is that something is wrong in the routing configuration.

Try logging the request going right before the deeplink middleware

// Deeplinking into apps
app.route('/deeplink*').get(function(req, res, next) { 
  console.log('here') 
  next()
}, core.deeplink);

Also, your fallback is defined as

http://localhost:3000

Do you have a route that listens there ?
Try changing it to something that you know is up like

http://google.com

from node-deeplink.

jaikumar-b avatar jaikumar-b commented on June 1, 2024

I don't think its a routing issue since I an able debug via the node inspector and see that the flow actually goes to the deeplink library and the javascript data to be inlined is constructed. After the inline html piping with response, I don't see any response body being constructed.

from node-deeplink.

mderazon avatar mderazon commented on June 1, 2024

Can you post a complete sample code ?

from node-deeplink.

jaikumar-b avatar jaikumar-b commented on June 1, 2024

Just uploaded the repo. I am directly hitting the url from from iOS simulator after running the server.

https://github.com/codebreaker01/Deeplink

from node-deeplink.

mderazon avatar mderazon commented on June 1, 2024

the problem is the the MEAN server messes with the header type and sets it to text/plain instead of text/html

from node-deeplink.

mderazon avatar mderazon commented on June 1, 2024

try updating to v0.2.2 and see how it goes

from node-deeplink.

jaikumar-b avatar jaikumar-b commented on June 1, 2024

I updated the version. Now I am getting a different error. Was it working on the repo that I posted earlier?

simulator screen shot aug 17 2015 9 24 55 pm

from node-deeplink.

mderazon avatar mderazon commented on June 1, 2024

Do you have an app that can open the deep link ? Or can you try and open it in a real device ?

I think that you can't open itunes on the simulator

from node-deeplink.

jaikumar-b avatar jaikumar-b commented on June 1, 2024

Deeplinking and fallback to itunes both are working on a real device but deeplinking is not on simulator(though I have the app installed). Any reason why deeplinking isn't happening on simulator?

Btw, thanks for the prompt responses and getting this resolved. 👍

from node-deeplink.

mderazon avatar mderazon commented on June 1, 2024

Hmm, weird. Not sure why it doesn't work in the simulator. The fallback to itunes probably can't work there but not sure why it's not opening the app

from node-deeplink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.