10.2 InvokeActionItem

With the upgrade to the 10.2 my apps with the InvokeActionItem for the BlackBerry World don't wok more. Any suggestions?

you guys do this QML?

I had questions about the year 10.0 with her last and switch to a version of c ++ which is still working on the last update

I just tested and it works as well

* Assuming a context property is set in this example, it is RPC.

applicationUI.cpp

#include 
#include 
#include 
void ApplicationUI::invokeBrowser()
{
    InvokeManager manager;
    InvokeRequest request;

    // Setup what to show and in what target.
    request.setTarget("sys.browser");
    request.setAction("bb.action.OPEN");
    request.setUri("http://www.blackberry.com/");
    InvokeTargetReply *targetReply = manager.invoke(request);
    //setting the parent to "this" will make the manager live on after this function is destroyed
    manager.setParent(this);

    if (targetReply == NULL) {
        qDebug() << "InvokeTargetReply is NULL: targetReply = " << targetReply;
    } else {
        targetReply->setParent(this);
    }
}

applicationUI.hpp

public:
    ApplicationUI(bb::cascades::Application *app);
    virtual ~ApplicationUI() { }

    Q_INVOKABLE void invokeBrowser();

. QML

Button {
  onClicked: {
     cpp.invokeBrowser();
  }
}

Tags: BlackBerry Developers

Similar Questions

  • InvokeActionItem not visible on Z30

    Hello guys, I have developed an application that uses InvokeActionItems on the status bar to call actions such as sharing on facebook or NFC, when I applied to BFB, he rejected because these items were not visible on the bar and he just got the 'back' button, however, my application deploys perfectly Q10 and Z10. Any suggestions on this subject?

    Here's some of my code:

    InvokeActionItem {
                ActionBar.placement: ActionBarPlacement.OnBar
                title: qsTr("       Share on FB                             ")//qsTr("Post")
    
                query {
                    mimeType: "image/jpeg"
                    invokeTargetId: "Facebook"
                    invokeActionId: "bb.action.SHARE"
                    // Share an image that is packaged with the app
                    uri: _dirPaths.files + "1Meme.jpg"
                }
            }
    

    I did some research autour and unfortunately it seems that the problem is caused by a known issue with InvokeActionItem. Basically, on 10.2 If you specify an invokeTargetId it will fail, which will cause the ActionItem to not appear in the Bard of the action.

    I created this topic says follow: https://www.blackberry.com/jira/browse/BBTEN-1765

    I would still recommend a generic action (with no target specified) button. If you want a workaround solution for which specify you a target, you must create a custom class that manages it in the layer of C++, as the InvokeManager of the normal stuff still works.

  • ListView with InvokeActionItem

    Hi everyone, I am creating a list including an invokeactionitem to share something.

    However, I found that the invokeactionitem query is not accurate. Does anyone have an idea?

    Here's my simplified coding.

    {To ListView

    dataModel: myDataModel / / coding datamodel created by c ++

    ListItemComponents:]

    {ListItemComponent}

    {Of container

    {Label

    text: ListItemData.content

    }

    contextActions:]

    ActionSet {}
    {InvokeActionItem}
    query {}
    mimetype: "text/plain".
    data : ListItemData.content / / data not always as same one I want to share
    invokeActionId: "bb.action.SHARE".
    }
    }
    }
    ]

    }

    }

    ]

    onCreationCompleted: {}

    myDataModel.loadData (); loadData is a function to insert an item in the datamodel

    }

    }

    I already found a solution.

    InvokeActionItem is created after the creation of the ListItemComponent. Thus, the query can get different data of ListItem.

    For example, the ListView creates #21 ListItem. But the InvokeActionItem of #19 ListItem is just started to create. Finally, it will get a bad data from the ListItemData.

    Instead of using InvokeActionItem, directly using ActionItem, it's much better since the period created the ActionItem is as even the ListItem. If the ActionItem can always get the current ListItemData.

    Here is the code that I currently use and it always returns the correct value for my InvokeQuery.

    http://supportforums.BlackBerry.com/T5/Cascades-development/dynamic-InvokeQuery/m-p/2084381#M10730

    {To ListView

    dataModel: myDataModel / / coding datamodel created by c ++

    ListItemComponents:]

    {ListItemComponent}

    {Of container

    {Label

    text: ListItemData.content

    }

    contextActions:]

    ActionSet {}
    {ActionItem}

    Title: qsTr ("action")

    onTriggered: {}
    query.mimeType = "text/plain".
    Query.Data & Colon = ListItemData.content / / data not always as same one I want to share
    query.updateQuery ();
    }

    attachedObjects:]

    {Of invocation

    ID: Summoner

    query: InvokeQuery {/ / show editor QML here has the error, but it's correct coding}

    ID: query

    Here must be empty and not a query is complete, otherwise the function onArmed will be reported once the object is created.

    }

    onArmed: {}

    Trigger ("BB.action.Share");

    }

    }

    ]
    }
    }
    ]

    }

    }

    ]

    onCreationCompleted: {}

    myDataModel.loadData (); loadData is a function to insert an item in the datamodel

    }

    }

  • InvokeActionItem unrecognized - does not appear in the menu

    Could not get InvokeActionItem to acknowledged or executed

    Copied documentation on codes ffrom (2 places, more or less identical) and added to my actions. My ActionItems always appeared in menu and run but the InvokeActionItem entries not included in the menu and when I have them forced the ActionBar I get the error below at run time

    QML Code

    at the end of the definition of the page

    actions:]

    {ActionItem}

    Title: qsTr ("Sound")

    ActionBar.placement: ActionBarPlacement.OnBar

    onTriggered: {}

    myClass.displaySettingsPage ("sound");

    }

    },

    {ActionItem}

    Title: qsTr ("BBM: display and update the profile" "")

    ActionBar.placement: ActionBarPlacement.OnBar

    onTriggered: {}

    myClass.displayProfilePage (); example

    }

    },

    Recompiled with Gold version and InvokeActionItems now appear in the menu. They are all grouped together after action items menu regardless of where they are placed in QML.

    Now just to figure 1) why I can no longer save app with BBM in gold and 2) how dynamically change the uri because there is no prompt

  • InvokeActionItem in Menu.definition

    Hello

    I wanted to put InvokeActionItem in Menu.definition, but it doesn't seem to work

    Menu.definition: MenuDefinition {
        id: menuDefinition
        actions: [
                InvokeActionItem {
                    id: tweetAction
                    title: "Tweet"
                    imageSource: "asset:///ic_twitter.png"
                    query {
                        mimeType: "text/plain"
                        invokeTargetId: "Twitter"
                        invokeActionId: "bb.action.SHARE"
                    }
                    onTriggered: {
                        data = "Hello tweet"
                    }
                }
        ]
    }
    

    I get the runtime error. Is it possible to do a work around?

    Hello

    Try this

    import bb.cascades 1.0
    
    Page {
        Menu.definition: MenuDefinition {
            id: menuDefinition
            actions: [
                ActionItem {
                    id: tweetAction
                    title: "Tweet"
                    onTriggered: {
                        invoke.trigger("bb.action.OPEN");
                    }
                }
            ]
        }
    
        content: Container {
            Label {
                text: "Click on Tweet from Menu."
            }
        }
    
        attachedObjects: [
            Invocation {
                id: invoke
                query {
                    uri: "http:///www.google.co.in"
                    invokeTargetId: "sys.browser"
                }
            }
        ]
    }
    
  • InvokeActionItem, create QML provided 2 generated ActionItems

    Hi, the code below gave rise to TWO InvokeActionItems on the bar below. Someone knows why?

    Page {
                id: helpPage            actions: [
                    InvokeActionItem {
                 ActionBar.placement: ActionBarPlacement.OnBar
                         query.mimeType: "text/plain"
                         query.invokeActionId: "bb.action.SHARE"
                         query.data: "TEST"
                     }
             ]
    
            }
    

    Hello

    It could be this question:

    http://supportforums.BlackBerry.com/T5/Cascades-development/duplicate-ActionBar-buttons/m-p/2157969#...

  • How to share the URL with InvokeActionItem?

    the following used to work in beta4release code:

    InvokeActionItem {
                title: qsTr("Share")
                ActionBar.placement: ActionBarPlacement.OnBar
                query {
                    mimeType: "text/plain"
                    invokeActionId: "bb.action.SHARE"
                }
                onTriggered: {
                    var t = "http://www.google.ca";
                    data = t
                }
            }
    

    but he no longer shares nothing in the GOLD release (for example, BBM is launched but no text is sent/typed)...worked in NFC and BBM beta4

    haven't tried other types mime as text/url text/txt,... but stiill no results...

    someone at - he could share the URL in the Gold release?

    The code above worked fine for me at 10.0.9.1675.  Can you confirm the version of the OS you are using?

  • Via InvokeActionItem file sharing appears NFC

    The problem I see, is that I have a file with a custom. When you use the InvokeActionItem to share (bb.action.SHARE), I can not everything other then NFC (BBM, email and so on are not available). The file, filename.xyz, just contains XML code that my application handles the opening.

    So, how can I fix?

    Code:

     

    {InvokeActionItem}
    ID: shareIPBtn
    Title: qsTr ("share IP")
    ActionBar.placement: ActionBarPlacement.InOverflow
    imageSource: "asset:///images/share.png."

    query {}
    MIME type: ' application/xml '.
    invokeActionId: "bb.action.SHARE".
    }

    onTriggered: {}
    data = ServerRepository.getServerFilePath (hostIPStr.text); Returns the name of the file
    }
    }

    So the solution is not quite as clean as I'd hoped it would be. When you define a query of InvokeActionItem, the uri must point to a file that exists on the file system. The mime type is then used to determine how the file can be sent via.

    It is certainly a requirement without papers. What did my code was to create the file to transfer when InvokeActionItem-> onTriggered() is called. This is because the content of the file depends on what the InvokeActionItem has been used. A sharing would result in another file that sharing B.

    Anyway, my solution was to create an empty file just for the InvokeAction query can be satisfied. When onTriggered() is called, then I write to have the file and the file is sent in the chosen language.

    What I find frustrating, is that the contents of the file has no impact on what is the InvokeActionItem; This responsibility lies with the mime type. So, I ask you, what's the point to check if the file exists?

  • Connection to the canal of BBM

    Is there a way to connect directly to / open a channel of BBM?

    I don't want the application to you subscribe to the channel, but just open BBM to the channel so that the user can see the channel and decide for themselves.

    I know that I can open the url PIN, but it was through the web browser by using code c ++ for opening a URL.

    I couldn't add it to the MenuDefinition, so I've added it to the Actions

    InvokeActionItem {
              ActionBar.placement: ActionBarPlacement.OnBar
              query {
                       invokeTargetId: "sys.bbm.channels.card.previewer"
                       invokeActionId: "bb.action.OPENBBMCHANNEL"
                       uri: "bbmc:C004DD717"
                }
    }
    

    The only problem with this is that it opens the BBM channel on top of the application.

  • Citing the BBM in qml

    Hello guys how are you

    I try to call bbm to open my bbm channel in qml, I'm stuck in these codes and I don't know what to do

    {ActionItem}
    Title: 'BBM CHANNEL. "
    imageSource: "asset:///icons/ic_notes.png."
    attachedObjects:]
    {InvokeActionItem}
    ID: bbm
    query {}
    invokeTargetId: "sys.bbm.channels.card.previewer".
    invokeActionId: "bb.action.OPENBBMCHANNEL".
    URI: "" bbmc:".
    }
    }
    ]
    onTriggered: {}

    }
    }

    I tried many things, but all of them didn't work

    Also I don't know how to trigger the call using onTriggered

    any help on this?

    Thanks a lot guys

    Please note that I am glad that I can help , what I did was simply using propety Invocation in an attachedObjects

    That's what I did

    {ActionItem}
    Title: "my string".
    imageSource: "asset:///icons/ic_bbm.png."
    attachedObjects:]
    {Of invocation
    ID: invokeBBMC
    query {}
    invokeTargetId: "sys.bbm.channels.card.previewer".
    URI: "bbmc:C002151A4".
    }
    }
    ]
    onTriggered: {}
    invokeBBMC.trigger ("bb.action.OPENBBMCHANNEL")
    }

    You can find more information, so that the implementation that c ++ here:

    https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__invocation.html

    Peace

  • Calling function in QML?

    Hi all

    I need to call invite to BBM while clicking on a qml button, I am attaching my code example, but it does not

    Button {
               text:"Invite"
               id: invite_button
                onClicked: {
                invokeQuery.updateQuery();
                 }
                  attachedObjects: [
                        InvokeActionItem {
                          id:invokeQuery
                          title: "Invite to BBM"
                         query {
                         invokeActionId:"bb.action.INVITEBBM"
                               uri: "pin:2100000A"
                          }
                        }
                      ]
                    }
    

    How can someone send me some solutions for this problem. ?

    Thank you

    Hi all

    I found a solution about the guest call to BBM at the click of a button, I can't go to invite page but can not able to send invitations by selecting contacts, here is my code

    Button {
                text: "Invite"
                onClicked: {
                    invokeQuery.uri = "pin:210000A"
                    invokeQuery.updateQuery();
                }
                attachedObjects: [
                    Invocation {
                        id: invokeShare
                        query: InvokeQuery {
                            id: invokeQuery
                        }
                        onArmed: {
                             trigger("bb.action.INVITEBBM");
    
                        }
                    }
                ]
            }
    

    Can someone send me solutions

  • Menu selection target question

    Hello!

    How to open the menu of target selection inside the application? I watched invokeclient sample from samples of waterfalls, but as an example and link menu are different.

    Any ideas?

    I have the solution, is name: InvokeActionItem

  • Is it possible to Exchange by BBM app-specific data?

    Hello

    I'm writing a kind of task list manager. However I was considering the possibility to share a task with BBM contacts. A contact who would receive such a task could click on it, then add it to his own app.

    This could be done on BBM?

    Thanks in advance.

    Flow of data from one application to another using the BBM API is available for BBM on BlackBerry OS 5-7, but is not currently available on BlackBerry 10.  It's something we look for in the launch post.

    But you could do it using the framework of the call for your application.  You could create an InvokeActionItem that send a file with a time of mime/extension custom during a BBM chat session in your application as follows:

    InvokeActionItem {
        title: "Share Image Over BBM"
        query {
            invokeTargetId: "sys.bbm.sharehandler"
            invokeActionId: "bb.action.SHARE"
            uri: "file:///accounts/1000/shared/misc/file.tsk"
        }
    }
    

    Your application should also be part of the call as Manager for this type of mime/extension.  Then when the user receives the file, they could click on it to open the taskj in your application.

    Not as transparent as the streaming directly from one application to another, but it might be easier for now buliding your own server infrastructure.

  • Share multiple photos via share framework

    Hello

    I'm trying to share multiple photos through the framework of the action, but the code below only allows me to create new tasks with them. How can I share multiple photos like the app native photo?

    InvokeRequest invokeRequest;
    invokeRequest.setAction("bb.action.SHARE");
    invokeRequest.setUri("list://");
    invokeRequest.setData(itemPathList.toUtf8());
    invokeRequest.setMimeType("filelist/image");
    invokeManager->invoke(invokeRequest);
    

    One more suggestion...  Try to use bb::cascades:Invocation, which behaves more like the InvokeActionItem (making an independent invoke) that use InvokeRequest directly.

    Here is an example:

    void MyClass::someFunction() {
        . . .
        InvokeQuery *query = InvokeQuery::create()
            .mimeType("filelist/media")
            .uri("list://")
            .data(data);
        Invocation *invocation = Invocation::create(query);
        query->setParent(invocation);
        connect(invocation, SIGNAL(armed()), this, SLOT(onInvocationArmed()));
        connect(invocation, SIGNAL(finished()), invocation, SLOT(deleteLater()));
    }
    
    void MyClass::onInvocationArmed()
    {
        Invocation *invocation = qobject_cast(sender());
        invocation->trigger("bb.action.SHARE");
    }
    
  • Invoke the BlackBerry World to classify my app

    Is it possible to invoke the BlackBerry World to allows users to give my app a rating using an InvokeActionItem?

    Hi macaronlover,

    Order this link which describes how to call BlackBerry app World: http://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/blackberry _...

Maybe you are looking for

  • What benefit comes from an external hardrive? It will allow my Skype video calls be better quality &#62;

    My web cam sends a photo of feverishness to the correspondent. I was told that this is due to the lack of memory and that another HDD would fix it.

  • photo frames mini won't autostart

    I bought 4 Kaiserbass mini brand photo digital keychain to give parents like presents and I intend to put my own pictures on the photo frames before you give them as gifts. I connected one of them, who, after having followed the instructions, has con

  • Problem with remote access VPN on ASA 5505

    I currently have a problem of an ASA 5505 configuration to connect via VPN remote access by using the Cisco VPN Client 5.0.07.0440 under Windows 8 Pro x 64. The VPN client will prompt you for the user name and password during the connection process,

  • Windows 7 is not supported (the screen brightness problem)?

    I called Lenovo technical support to see if they had a solution for unable darken the screen in Windows 7.  The suport person told me to load the most recent drivers.  I did and then recalled with my file number.  I told them that the suggestion did

  • Problem with receiving Internet in Inspiron 3847?

    My computer is a Dell Inspiron 3847, and I noticed internet connect seems to disconnect sometimes. The only way to fix this is by unplugging completely reconnect. This isn't a problem with my internet because it only happened on my laptop. It usually