小编ber*_*ben的帖子

使Ionic应用程序出现在"共享"列表中并接收数据

当用户单击图像的共享按钮时,我试图让"离子"应用程序出现在"共享"列表中.

分享示例

据我所知,我必须添加类似的东西

<intent-filter> 
   <action android:name="android.intent.action.SEND" />
   <category android:name="android.intent.category.DEFAULT" />
   <data android:mimeType="image/*" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

到了AndroidManifest.xml.我认为,我可以使用cordova-custom-config插件.
然后,我必须以某种方式处理这个意图,这对我来说是棘手的.看起来像目前为意图维护的唯一的cordova插件就是这个.我尝试过这样使用它:

  initializeApp() {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      this.statusBar.styleDefault();
      this.splashScreen.hide();
      this.registerBroadcastReceiver();
    });
  }
  private registerBroadcastReceiver(){
      window.plugins.intentShim.registerBroadcastReceiver({
          filterActions: [
              'com.darryncampbell.cordova.plugin.broadcastIntent.ACTION'
              ]
          },
          function(intent) {
              //  Broadcast received
              console.log('Received Intent: ' + JSON.stringify(intent.extras));
          }
      );
  }
Run Code Online (Sandbox Code Playgroud)

但是这样我得到一个错误,即window.plugins是未定义的.我真的不知道如何将它与Ionic结合起来. …

android ios cordova ionic-framework ionic3

20
推荐指数
1
解决办法
5649
查看次数

在 Web Worker 中使用 Canvas

有没有办法在 Web Worker 中使用 Canvas 元素?我想在 Web Worker 内部执行 canvas.toBlob 来降低图像质量

  • 我知道只有 ImageData 可以传递给 Web Worker,这对我没有帮助,我需要画布,而不是 canvasContext 来执行 canvas.toBlob
  • 我知道 Firefox 中实验性的离屏 Canvas,但我也希望其他浏览器支持。

就像也许通过https://github.com/substack/webworkify webworkify 一样?哪个允许在网络工作者中需要其他库?

我要么需要将 canvas 元素传递给 Web Worker,要么在 Web Worker 内部创建一个 canvas 元素,要么找到一种替代方法来降低图像质量。

javascript canvas web-worker html5-canvas

5
推荐指数
1
解决办法
5198
查看次数

Angular 2 Router 等待组件上的动画完成,然后在路由更改时销毁它

我想创建一个模块来侦听路线更改,并在路线更改时根据当前路线和转到下一条路线执行给定的动画。基本上它应该解决这个问题:https://github.com/angular/angular/issues/9845
像这样(草稿注释):https://github.com/bergben/ng2-page-transition/issues/6

现在要做到这一点,我想通过组件进入和离开时的路线数据执行给定的动画。该动画可能会根据当前路线和下一条路线而有所不同。例如,切换到/mainfrom/first可能会触发后退动画,而切换到/mainfrom/second可能会触发前进动画。

现在的问题是:如何将此动画绑定到组件并允许其完成?路由器渲染一个像这样的组件:

<router-outlet></router-outlet>
<my-current-component>...</my-current-component>
Run Code Online (Sandbox Code Playgroud)

但在路线改变时,它会立即销毁<my-current-component>...</my-current-component>并用新组件替换它。

我知道将动画绑定到组件装饰器中的主机如下: https: //github.com/designcourse/angular-auth-demo/blob/master/src/app/login/login.component.ts#L11 允许它们去完成。但我无法更改路由更改时的组件(它是一个常量,请参阅https://angular.io/docs/ts/latest/api/router/index/ActivatedRoute-interface.html#!#component-anchor

我应该提到的是,我发现将另一个元素包裹在渲染的组件周围,例如

<router-outlet></router-outlet>
<div>
   <my-current-component>...</my-current-component>
</div>
Run Code Online (Sandbox Code Playgroud)

防止路由器破坏组件。但直接访问 DOM 并不是最佳实践。我只会认为这是最后的手段。如果有人知道如何<div></div>通过 Angular Renderer 或 ViewContainerRef 等来包装组件,那么我很高兴听到这一点。然后我可以将动画绑定到该<div></div>包装器并在动画完成后手动销毁它。

动画应该在不延迟新组件进入动画的情况下执行。

所以我希望有人能够对如何以最好的方式实现这一目标提出想法/建议。

angular2-routing angular

5
推荐指数
0
解决办法
1217
查看次数

Firebase 身份验证:在特殊电子邮件地址(例如 *@gmx.at)上发送但未收到的电子邮件

我在我的 Ionic 应用程序中使用Firebase 身份验证一些用户报告没有收到用户注册后或触发 resendVerificationEmail 时发送的验证电子邮件。

这对于 @gmail.com 或 @live.de 等电子邮件提供商来说效果很好,但对于拥有@gmx.at 等特殊提供商的其他用户来说,它不起作用。根据firebase,电子邮件已成功发送,但从未收到。

可能是邮件被过滤了?还有其他人遇到过这个问题吗?消息模板无法修改,但使用自定义 SMTP 服务器可能有帮助吗?

smtp firebase ionic-framework firebase-authentication

5
推荐指数
1
解决办法
1819
查看次数

将响应CMS推送到Heroku:没有找到'composer.lock'

我想在Heroku上托管Respond CMS,所以我做了:

  1. git clone 响应存储库的
  2. heroku 在该文件夹中创建
  3. git push heroku master

我总是在终端中收到以下错误:

remote: ----->PHP app detected
remote:
remote:  !     ERROR: Your 'composer.json' lists dependencies inside 'require',
remote:        but no 'composer.lock' was found. Please run 'composer update' to
remote:        re-generate 'composer.lock' if necessary, and commit it into your
remote:        repository. For more information, please refer to the docs at
remote:        https://devcenter.heroku.com/articles/php-support#activation
remote:
remote:
remote:  !     Push rejected, failed to compile PHP app
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected …
Run Code Online (Sandbox Code Playgroud)

git heroku composer-php respondcms

0
推荐指数
1
解决办法
2754
查看次数