diff --git a/src/pages/stream/stream.ts b/src/pages/stream/stream.ts index d2d45b2..75f8754 100644 --- a/src/pages/stream/stream.ts +++ b/src/pages/stream/stream.ts @@ -350,6 +350,13 @@ export class StreamPage { + + + + +

filename

+
+
` @@ -418,10 +425,12 @@ export class NewPostModal { this.options['raw'] = this.raw; pnut.createPost(this.ptext, this.options).then(res => { - console.log(res); + console.log('-success-'); + console.log(JSON.stringify(res)); this.presentToast("Status posted."); this.events.publish('stream:reload', {}); }).catch(err => { + console.log('-error posting-'); console.log(JSON.stringify(err)); }); this.viewCtrl.dismiss(); @@ -491,8 +500,21 @@ export class NewPostModal { fileTransfer.upload(this.fpath, 'https://api.pnut.io/v0/files', options).then((response) => { console.log('-file created-'); - console.log(JSON.stringify(response)); + console.log(response.response); console.log('-file created-'); + let rdata = JSON.parse(response.response); + let oembed = { + '+io.pnut.core.file': { + file_id: rdata.data.id, + file_token: rdata.data.file_token, + format: 'oembed' + } + } + console.log(JSON.stringify(oembed)); + this.raw.push({ + type: "io.pnut.core.oembed", + value: oembed + }); }).catch((err) => { console.log('-create file error-'); console.log(JSON.stringify(err));