Incoming Push invoking browser

I played with the sample code pushCollector. However I stumbled across a weird problem.

In the pushNotificationHandler (app.cpp) service, I try to call the webbrowser (code example below).

The code works fine, if the application is started and in the foreground, but does not work when the application is started from the invocation to push himself.

    QString URL = "http://www.google.com";
    InvokeManager invokeManager;
    InvokeRequest request;
    request.setTarget("sys.browser");
    request.setAction("bb.action.OPEN");
    request.setMimeType("text/html");
    request.setUri(QUrl(URL));
    invokeManager.invoke(request);

As this cannot be debugged easily (app must be closed in order to reproduce), I would like to know if anyone has an idea, what's not here.

So, after talking with the team of the invocation, it seems that not being is not able to issue an invoke through an application running in the background is expected behavior.

Here's the exact warning in the newspapers that I get when I tested it myself:

WARNING - background application 'pushcapture.testRel_pushcaptureb8c6c6ec' is not the right to call for applications

 

The reasoning behind this is a user experience.  Your application runs in the background, so it should not be able to invoke / run another application in the foreground (for example, the browser).

That being said, there is a possible option, I can think of off the top of my head.  You could add a notification on the BlackBerry Hub and when the user opens your app and the related push, launch the browser with the appropriate content.  I'm not sure if the URL you were trying to open in the browser is directly related to your push button.  I'm just speculating.  Are related somehow?

If you tell me your specific scenario, I might be able to think of other options as well.

Thank you

Matt

Tags: BlackBerry Developers

Similar Questions

  • Invoking browser by clicking on a button (QML)

    Hello

    I try to call the browser at a certain URL by clicking a button. I did InvokeActionItems where you put in a block of query and add the invokeTargetid, the invokeActionId and the uri.

    However, for a button, it seems a bit of a hack of the irrational and little messy code. This code WORKS next, but gives me an error in the "InvokeQuery" saying "read only property cannot be set.

    Here's the code. Fact all look right and anything maybe cleaned? The whole "onArmed" and the attached Invocation object looks a bit weird.

    Button {
                        id: googleMapButton
                        overlapTouchPolicy: OverlapTouchPolicy.Allow
                        text: "Google"
                        onClicked: {
                            invokeGoogleMapQuery.uri = "http://maps.google.com/"
                            invokeGoogleMapQuery.updateQuery();
                        }
    
                        attachedObjects: [
                            Invocation {
                                id: invokeGoogleMap
                                query: InvokeQuery { // *error here
                                    id: invokeGoogleMapQuery
                                    invokeTargetId: "sys.browser"
                                }
                                onArmed: {
                                    trigger("bb.action.OPEN")
                                }
                            }
                        ]
    
                    }
    

    Try this...

                Button {
                    text: "Invoke Browser"
                    onClicked: { invokeBrowser.trigger("bb.action.OPEN") }
    
                    attachedObjects: [
                        Invocation {
                            id: invokeBrowser
                            query.invokeActionId: "bb.action.OPEN"
                            query.invokeTargetId: "sys.browser"
                            query.uri: "http://www.stok.biz"
                        }
                    ]
                }
    
  • Invoking browser on Playbook

    I cannot get the browser starts the emulator when that invokes Web works

    my manifesto:


     
     
     
     

    Code:

    var args = new blackberry.invoke.BrowserArguments ("http://www.cnn.com");

    BlackBerry.Invoke.Invoke (blackberry.invoke.APP_BROWSER, args);

    Anyone got any ideas?

    The Simulator has currently this feature (it can not play sound either) so that we can just pray that our code is correct.

  • invoke browser

    Hello

    I try to call from a webworks app browser and its does not work and I can't find my mistake:

    looks like a link:

    var html = '

    '+title+'

    '+desc+'

    ';

    the JavaScript function: I've changed for the test:

    function openBrowser(url) {
      var args = new blackberry.invoke.BrowserArguments('http://www.blackberry.com');
      blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
    }
    

    his does not work at all on a real device or in training. The necessary features are enabled.

    What Miss me?

    the trick is to add an addition "as:

    openBrowser(\''+link+'\');
    
  • Has there been a fix - invoke browser to play the video, then return to original app?

    It is esay for an application call the web browser and it powers a url to play the video with Media Player. The problem is that if the user presses the 'Back' button while the media player is open, and they had before the browser open with pages of its history, the previous web page, instead of going back the original app.

    In the thread below, Mark responded that there is no way to go back to the original app in the above case. It has been four months since, has there been a fix or work around for?

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=25230&query.ID=78...

    Without a work-around, it would be a painful experience

    Thank you

    There is no solution for this scenario.  The best way to handle this current version of BlackBerry device software would be to play the video in your own application by using the player class instead of launching the browser.

  • When travel abroad (overseas) and use the WIFI, I can get incoming emails and browse the web, but cannot send emails.

    If I can find the SMTP that is used by the hotel, I can simply change my outgoing SMTP accordingly. But invariably, they do not understand the issue and unless I can find the outgoing SMTP, I'm unable to send.

    Is it possible to automatically pick up the SMTP Protocol out of the WIFI service that I use? How can I change my settings to do this?

    No, there is no easy way to do it, because the SMTP settings are often specific to the provider.  What you might try is to contact your local ISP and see if they can give you an option to send when you are not connected to them.  In addition, you can use webmail to access and send e-mail.  If your ISP doesn't have this option, there are several free accounts or cheap you can register for (gmail, hotmail, yahoo, etc.).

    Steve

  • Push browser in BES 10

    I use BES 10 and you want to use the mechanism to push browser. I used this code for BES 5 where 7874 is port for listening e-mail push device browser. What should I do to use all pushing in BES 10 of e-mail? And what port should I use?

    http://bes1.somecompany.com:8080/push?DESTINATION=2086dbf4&
    PORT=7874&REQUESTURI=/
    

    Push browser and other types of special push, push and push message channel browser are not supported by BES10 and BlackBerry 10 devices. You can replace this with an app that has received normal growth and published a notice to the user.

  • Could not invoke the browser

    Hi guys,.

    When I run the form module im getting an error of form cannot invoke browser.
    http://ImageShack.us/photo/my-images/197/unled2mgi.PNG/


    I put the path to the browser in the registry.pls see link below
    http://ImageShack.us/photo/my-images/11/unled1xhs.PNG/

    How do I rectify this error?

    Thanks in advance

    form of location of browser web builder - Edition - Preferences - DURATION.

  • 'Open in browser' and 'Share' problem

    Hi all

    Working on my first application. I'm done for the most part, but I can't for the life of figure me out how to get the invocations of work.

    The application load an arbitrary URL, found in the detailView.url variable in a WebView. It works very well. However, I can't spend detailView.url on an Invocation to open in a browser or a share. If I have the detailView.url on the console output, it gives me the correct URL.

    That's what I have so far:

                   attachedObjects: [
                        Invocation
                        {
                            id: invokeBrowser
                            query: InvokeQuery
                            {
                                mimeType: "text/html"
                                invokeActionId: "bb.action.OPEN"
                            }
                        }
                    ]
    
                    actions: [
                        ActionItem {
                            title: "Open in Browser"
                            imageSource: "asset:///images/ic_open.png"
                            ActionBar.placement: ActionBarPlacement.OnBar
                            onTriggered: {
                                invokeBrowser.query.uri = detailView.url;
                                console.log(detailView.url);
                                invokeBrowser.trigger("bb.action.OPEN");
                            }
                        }
                    ]
                }
    

    In the console, it gives me the following error:

    InvocationWrapper::onQueryFinished: no matching result from Menu Service for query
       mimeType="text/html"
       uri=QUrl("")
       data= ""
       metadata= QMap()
       perimeter= 0
       action= "bb.action.OPEN"
       target= ""
       invokerIncluded= false
    

    I tried to understand this point for a few days now and just can't seem to wrap my head around it. Does anyone have any suggestions?

    Thank you!

    I suggest to use an InvokeActionItem instead, here's an example that I have to change the data in the call, I'm sure you can adapt for your code...

    {
        [ ... ]
    
        actions: [
            InvokeActionItem {
                id: iaiBrowser
                title: "Invoke Browser"
                query.invokeActionId: "bb.action.OPEN"
                query.invokeTargetId: "sys.browser"
                query.uri: "http://www.stok.biz"
            }
        ]
    
        onCreationCompleted: {
            iaiBrowser.query.uri = "http://www.google.com"
        }
    
        [ ... ]
    
    }
    
  • Browser running in background

    Hello

    I made a simple application that opens a Web page (link type).

    The problem is that in some models of BB, the browser starts and runs in the background, it seems that the application does not work.

    This is the code:

    public class bBB extends UiApplication {}
    Public Shared Sub main (String [] args) {}
    bBB PAP = new bBB();
    theApp.enterEventDispatcher ();
    }
    public bBB() {}
    pushScreen (new TEST());
    }
    }

    final class TEST extends form {}
    public TEST() {}
    Super();
    Private private = Browser.getDefaultSession ();
    browserSession.displayPage ("http://www.google.com/");
    System.Exit (0);
    }
    }

    How can I solve it?

    Thank you

    I've seen the same behavior. My guess is that some pages are not displayed properly, so the browser does not come to the foreground.

    You can check the foreground process and push the browser in the foreground, if it is not visible now.

    net.rim.device.api.system.ApplicationManager
    
    requestForeground(int processId)
    Sends a foreground request to application with specified process ID.
    
  • Safari 9.0.2 and issue of HTML5

    I'm under El Capitan 10.11.2 and Safari 9.0.2. There's a plugin video silverlight which modernized with changes in the operating system in recent years. I sometimes watch a video in continuous which blocks or pads for periods of time, sometimes long periods. I read that ability of HTML5 is automatically included in Safari and it is the preferred option, but I can't find a prompt anywhere to push the browser using this ability for video streams. Of course, I can uninstall silverlight and its taking in. Anyone know if this is safe and resolve the issue please.

    Try to go on Safari, Preferences, security, Internet Plug-ins and uncheck Silverlight. Restart Safari and test.

  • For the operation of broadcasting how can I get the current network address of BB device

    Hello

    I'm new to the development of BB. I want to develop a Java application or servlet I can send order button to my client devices on BES... I would like to know a few things

    • First of all know if its possiable to apply a base or servlet Java?...
    • How to know current network address of the BB device that uses BES...

    Experts of BB please help... I would like to know I can start with...

    Thanks in advance...

    (I'm in the right forum for these questions)

    Hello

    When you tap on a BlackBerry smartphone, push you to address email or PIN code associated with the device. These can be already known or read the BES.

    Push of browser channel can certainly be handled from a Java application, check on the HTTPDemo (server side) included with the BlackBerry can and JDE plug-in for Eclipse (eJDE) that shows this.

    http://NA.BlackBerry.com/eng/developers/javaappdev/devtools.jsp

    http://docs.BlackBerry.com/en/developers/deliverables/10155/index.jsp?name=http+push+sample+applicat...

    Kind regards

  • Webpage of the launch system dialog box

    How can I run a particular Web site when the user selects the option confirm in a dialog system?

    {SystemDialog}

    ID: facebookQmlDialog

    Title: «Outputs Expert London on Facebook»

    body: "this page is going on in the browser." If you are using 3 G or 4 G, then you may incur data charges. »

    onFinished: {}

    If (facebookQmlDialog.result is

    SystemUiResult.ConfirmButtonSelection)

    ?;

    }

    }

                Button {
                    text: "Invoke Browser"
                    onClicked: { invokeBrowser.trigger("bb.action.OPEN") }
    
                    attachedObjects: [
                        Invocation {
                            id: invokeBrowser
                            query.invokeActionId: "bb.action.OPEN"
                            query.uri: "http://www.stok.biz"
                            query.invokeTargetId: "sys.browser"
                        }
                    ]
                }
    
  • PushApplication onMessage is called several times

    Hi guys,.

    I contacted my team BE but I'm waiting for answer, I want to ask the community:

    Your onMessage is called repeatedly with the same message?

    I see in the code for the examples of the RIM, they check that this message is new (not melted yet):

        public static void process( PushInputStream pis, Connection conn ) {
            Logger.log( "Reading incoming push message ..." );
    
            try {
    
                HttpServerConnection httpConn;
                if( conn instanceof HttpServerConnection ) {
                    httpConn = (HttpServerConnection) conn;
                } else {
                    throw new IllegalArgumentException( "Can not process non-http pushes, expected HttpServerConnection but have "
                            + conn.getClass().getName() );
                }
    
                String msgId = httpConn.getHeaderField( MESSAGE_ID_HEADER );
                String msgType = httpConn.getType();
                String encoding = httpConn.getEncoding();
    
                Logger.log( "Message props: ID=" + msgId + ", Type=" + msgType + ", Encoding=" + encoding );
    
                if( !alreadyReceived( msgId ) ) {
    }
    }
    

    You have the same control in your application?

    Thank you

    Eugen

    There is no guarantee that dups can be sent to the device, but in my experience its pretty rare. You will need to add a message id to the http header when you tap the message to make it work.

  • Feature of live stream on app webworks

    Hi guys,.

    So I try to create an application that needs constantly to get data from a server at very regular intervals. Now I know everyone would jump to their feet and saying 'PUSH NOTIFICATION', but just before you do all this conclusion, pls take into account the following conditions.

    1. each user should be logged in order to access the app and would receive the data according to different variables together (different users with different content)

    2. There is a high volume of data received in one day so I'm a little afraid on the quota push push notification.

    3. I need the application to work like the way work the twitter for blackberry customers. When new tweets are automatically responsible even when the user is not at the forefront of the application.

    My biggest fear with the help of push notification is the various factors considered before determining what data a user receives. Also note that I've set up push notification in an earlier application and it works great but I am seriously looking at other options for this solution. Web Sockets would have been a great option but its only available on bb 0s 7 +.

    You are right regarding the polling stations. Basically, the client sends an Ajax request to see if there is new data, and the server responds with the State or new data.

    To activate Javascript and networking of execution, while the application is reduced (i.e. running, but not highlighted), you must ask the permission of run_when_backgrounded:
    https://developer.BlackBerry.com/HTML5/documentation/rim_permit_element.html

    If you include the blackberry.push, you get this feature by default as well.

    That being said, if the application is closed, you won't be able to run polling stations and will be able to listen to the incoming push notifications.

Maybe you are looking for

  • Re: Question on the Satellite A350-22Z GPS

    Hello My laptop is Toshiba Satellite A350-22Z. My GSP does not work. GPS Utility from Toshiba said GPS not supported, but I'm sure that I used my GPS on this computer. After that I reinstalled Windows 7 Ultimate x 64, I couldn't not do GPS works. I i

  • Profile registered customers 5.1 Manager spaces reserved only

    I have an interesting problem with Server 5.1 and the Profile Manager. After update, when I enter computers they appear as placeholders only. Has anyone else seen elsewhere? Since yesterday, wrap works as expected before the update. Even download Tru

  • My copies are always striated when I print from the ADF

    When I use my driver on my 8500 AIO, copies are seeded, but agreed when I use the scanner glass, the copies come out well.  I tried to clean the feeder, but I was unable to get rid of the streaks.  I used alcohol to friction on the rubber rollers and

  • Color transparency strobe is bogged down my computer CPU

    Good afternoon Recently, I have programmed an interactive floor plan that generates a transparent flashing color on top a png file imported. The flashing light is beautiful and exactly what I need, but I encountered some problems. I've referenced the

  • How to remove copies of audio files

    copies and shortcuts I downloaded my music from a disc, and when I opened the file, all my songs had 2 copies and context 1. In other words, 4 copies of each song. Can I remove all these copies and these shortcuts in one, or do I have to do each one