I'm assuming this is a bug in my code but for some reason it starts a bluetooth 
transfer (which fails in the simulator). I've included the entire web app (it's 
very small).

What am I missing here?
This is the code:

function tweet() {
  var oReq = new XMLHttpRequest();

  oReq.open("GET", "IMG_0001.png", true);
  oReq.responseType = "blob";
  oReq.onload = function(e) {
      var activity = new MozActivity({
        // Ask for the "share" activity
        name: "share",

        // Provide the data required by the filters of the activity
        data: {
          type: "image/png",
          number: 1,
          blobs: [oReq.response],
        }
      });

      activity.onsuccess = function() {
        var picture = this.result;
        console.log("A picture has been retrieve");
      };

      activity.onerror = function() {
        console.log(this.error);
      };

  }
  oReq.send();
}


_ michael

---
Michael Bishop
Hitpoint Studios
http://www.hitpointstudios.com




On Friday, June 28, 2013 at 2:33 PM, Alexandre Lissy wrote:

> Le 28/06/2013 18:16, Michael Bishop a écrit :
> > Hi All,  
> >  
> > I was writing my own twitter integration with my app using OAuth so I could 
> > post tweets with pictures. But it occurred to me that I might be able to 
> > just use the included twitter app to do it.
> >  
> > Does anyone know if the twitter app is set up to receive messages from 
> > other apps? I'd like to send it text+picture (the picture is generated from 
> > my app).
> >  
> > I've been looking through the source and activities.js looks like a good 
> > bet.  
>  
> It seems to handle the share activity, so no issue to do it from any
> other app. I'd say that if it does not work it could be considered as a
> bug :)
>  
> >  
> > _ michael
> >  
> > ---
> > Michael Bishop
> > Hitpoint Studios
> > http://www.hitpointstudios.com
> >  
> > _______________________________________________
> > dev-b2g mailing list
> > [email protected] (mailto:[email protected])
> > https://lists.mozilla.org/listinfo/dev-b2g
> >  
>  
>  
> _______________________________________________
> dev-b2g mailing list
> [email protected] (mailto:[email protected])
> https://lists.mozilla.org/listinfo/dev-b2g
>  
>  


_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to