3 Replies Latest reply on Feb 4, 2014 2:00 PM by nilsheuer

    Displaying notification from my Jive app in users inbox

    brettvanderhaar

      Is it possible to have a "deep link" to a Jive app post to a user's inbox based on something that happens in that app?  Where would I start to look at integrating this functionality in Jive?

        • Re: Displaying notification from my Jive app in users inbox
          gdinning

          Not sure if I understand...  You could have the app use the v3 API to send a direct message to a user:  Jive REST API v3.3 → DirectMessage entity  Is that what you're looking for?

            • Re: Displaying notification from my Jive app in users inbox
              brettvanderhaar

              I more want to send a "notification" similar to the one I got when you responded to this message.  One that is clickable and deep links into my app.

                • Re: Re: Displaying notification from my Jive app in users inbox

                  This depends on whether you want to create this from within your app, or externally.

                  From within your app:

                  Sadly, you are limited to the standard Jive content types.

                  Creating a deep link should work like this for you:

                  function createDeepLink(view, opt_params) {
                      var uri = "jive:app://" + view;
                      if (opt_params) {
                        uri += "?params=" + encodeURIComponent(JSON.stringify(opt_params));
                      }
                      return uri;
                    }
                  

                  This works for actions, for regular Jive content you might try this:

                          var artifactJson = {
                              display: {
                                  "type": "image",
                                  "previewImage": "https://icon.com/icon.png",
                                  "label": "This is a label"
                              },
                              target: {
                                  "type": "embed",
                                  "view": "embedded.track",
                                  "context": { "trackId": selection.track.trackId }
                              }
                          };
                          osapi.jive.core.container.artifacts.create(artifactJson, 'your.function.name', function (markupResponse) {
                              var artifactMarkup = markupResponse.markup, error = markupResponse.error;
                              var html = artifactMarkup ;
                              osapi.jive.core.container.editor().insert(html);
                          }, false, true);