共享与离子社交平台的链接时面临的问题

时间:2018-12-17 07:45:50

标签: angular ionic-framework ionic2 ionic3 deeplink

摘要-: 我正在开发离子应用程序,试图通过deepLink

在android平台上共享离子应用程序页面

问题-:当我共享页面链接时,在watsapp上显示--:           链接不是作为链接发送,而是作为文本发送。

详细信息

链接-> http://ionicapp://example.com/second

app.component ts文件 deepLink

import { Component, ViewChild } from '@angular/core';
import { Nav, Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { HomePage } from '../pages/home/home';
import { ListPage } from '../pages/list/list';
import { Deeplinks } from '@ionic-native/deeplinks';


@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  @ViewChild(Nav) nav: Nav;

  rootPage: any = HomePage;

  pages: Array<{title: string, component: any}>;

  constructor(public deeplinks: Deeplinks ,   public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
   // this.initializeApp();

    // used for an example of ngFor and navigation
    platform.ready().then(() => {
     statusBar.styleDefault();
     splashScreen.hide();

     this.deeplinks.route({
           '/' : {},
           '/second': { 'ThirdPage' : true }    }).subscribe((match) => {
       alert(JSON.stringify(match)) ; alert('matched');
     } , (noMatch) => {alert(JSON.stringify(noMatch)); alert('failed') })
     });

  }
}

component.ts用于在watsapp上共享

 shareViaWhatsapp(){
    alert('hello');
  this.socialShare
  .shareViaWhatsApp("https://ionicapp://example.com/second",null,"https://ionicapp://example.com/second")
  .then(() => {
    console.log('success');
  })
  .catch(() => {
    console.log('Error');
  });
}

0 个答案:

没有答案