Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8413765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:59:09+00:00 2026-06-10T00:59:09+00:00

I have two scenarios here. One is, my App is active in the background

  • 0

I have two scenarios here.

One is, my App is active in the background on my iPad. If I go to safari and click a link with my URL scheme, the App opens and displays an alert with the URL.

This is what I want!

Second scenario is when the App is inactive, and not in the background. Here the App launches, but the alert is never displayed. I can alert the URL out from “didFinishLaunchingWithOptions”, but I need it in my JavaScript function: handleOpenURL(url).

It seems to me that handleOpenURL in my AppDelegate.m is only fired when the App is in the background. Is there any way to make it do the same while not running in the background?

Here is my obj-c handleOpenUrl:

if (!url) { return NO; }

// calls into javascript global function 'handleOpenURL'
NSString* jsString = [NSString stringWithFormat:@"window.setTimeout(function(){ handleOpenURL(\"%@\"); }, 1)", url];
[self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];

// all plugins will get the notification, and their handlers will be called 
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];

return YES;

It should output to this javascript function:

function handleOpenURL(url) { 
    alert('invoke: ' + url);
}

Now when the App starts initially, it runs didFinishLaunchingWithOptions:

NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
NSString* invokeString = nil;

if (url) {
    invokeString = [url absoluteString];
    NSLog(@"iPaperReeder launchOptions = %@", url);
}

self.viewController.invokeString = invokeString;

Should I modify the didFinishLaunchingWithOptions method, to make it run handleOpenURL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:59:11+00:00Added an answer on June 10, 2026 at 12:59 am

    I figured it out. I was missing a call in the onDeviceReady function:

    if (invokeString) handleOpenURL(invokeString);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two distinct scenarios. One, where there is a many to many case,
I have two views in my app, one is a general view where CoreLocation
Here is my scenario: I have two MySQL tables: Categories (columns: id, category) Items
I have a generic question about scope and encapsulation. Take two scenarios: Scenario 1:
The scenario is I have two div s: one is where I select items
Scenario I have two WCF Services combined in a single App.Config file. I can't
I've seen several similar scenarios explained here but not my particular one. I wonder
I have two scenarios in Netty where I am trying to minimize memory copies
Here's my scenario: I have two tables A, B which (for the sake of
Here's my scenario: I have a page containing several links; each link is meant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.