ionic-native/clipboard doesn't work in iOS 11

Created on 1 Nov 2017  Â·  8Comments  Â·  Source: ionic-team/ionic-native

I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request

Current behavior:

Using ionic-native/clipboard, copy inside ionic app and paste to other app (ex iMessage or other things) worked fine in iOS 10. But after upgrade iOS11, only copy & paste inside same ionic app works fine, but paste to other app, does nothing.

This only happen in iOS11, other iOS10 or Android is fine.

Expected behavior:

Paste to other app in iOS11 should work.

Steps to reproduce:

in iOS11, inside ionic built app, copy using below related code

and paste clipboard information to other app (like iMessage)

does nothing.

Related code:

  pressCopy(message) {
    this.clipboard.copy(message).then(
      (resolve: string) => {
        this.presentToast();
      },
      (reject: string) => {
        console.log("Error : failed to copy");
      }
    );
  }

Other information:

package.json info:

 "dependencies": {
        "@angular/common": "4.4.3",
        "@angular/compiler": "4.4.3",
        "@angular/compiler-cli": "4.4.3",
        "@angular/core": "4.4.3",
        "@angular/forms": "4.4.3",
        "@angular/http": "4.4.3",
        "@angular/platform-browser": "4.4.3",
        "@angular/platform-browser-dynamic": "4.4.3",
        "@ionic-native/clipboard": "^4.3.1",
        "@ionic-native/core": "4.3.1",
        "@ionic-native/google-analytics": "^4.3.1",
        "@ionic-native/in-app-browser": "^4.3.2",
        "@ionic-native/keyboard": "4.3.1",
        "@ionic-native/splash-screen": "4.3.1",
        "@ionic-native/status-bar": "4.3.1",
        "@ionic/storage": "2.0.1",
        "cordova-android": "6.3.0",
        "cordova-clipboard": "1.1.0",
        "cordova-ios": "4.5.1",
        "cordova-plugin-console": "1.1.0",
        "cordova-plugin-device": "^1.1.6",
        "cordova-plugin-google-analytics": "^1.8.3",
        "cordova-plugin-inappbrowser": "^1.7.1",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.3",
        "cordova-plugin-whitelist": "^1.3.2",
        "cordova-plugin-wkwebview-engine": "git+https://github.com/driftyco/cordova-plugin-wkwebview-engine.git",
        "cordova-sqlite-storage": "^2.0.4",
        "ionic-angular": "3.6.1",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "ios-deploy": "^1.9.2",
        "ios-sim": "^6.0.0",
        "lodash": "^4.17.4",
        "moment": "^2.18.1",
        "moment-timezone": "^0.5.13",
        "rxjs": "5.4.3",
        "socket.io-client": "^1.7.3",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.18"
    },
    "devDependencies": {
        "@angular/tsc-wrapped": "^4.4.4",
        "@ionic/app-scripts": "3.0.0",
        "@types/lodash": "^4.14.72",
        "@types/moment-timezone": "^0.2.34",
        "@types/socket.io-client": "^1.4.29",
        "typescript": "2.3.4"
    },
    "cordova": {
        "platforms": [
            "android",
            "ios"
        ],
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "cordova-plugin-wkwebview-engine": {},
            "cordova-sqlite-storage": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-google-analytics": {},
            "cordova-clipboard": {},
            "cordova-plugin-inappbrowser": {}
        }
    }
improve plugin need to reproduce

Most helpful comment

It has been long time since iOS 11 is officially released.

But this problem doesn't fixed yet. Needs urgent help to fix this.

All 8 comments

i have the same issue

I have the same issue. I can paste within the same application but going to another application and pasting does not work.

It has been long time since iOS 11 is officially released.

But this problem doesn't fixed yet. Needs urgent help to fix this.

any updates there ?

Would like a fix here as well

as workaround you can try
cordova.plugins.clipboard.copy('Text for copy');
it works for me

Strange thing is, pasting in Notes does work, but in many apps (e.g. Facebook) it does not. When copying from another (non Ionic) app, pasting in those apps (e.g. Facebook) does work.

→ So, it seems that Ionic is copying in some sort of '_wrong format_', that many apps don't understand (but some, like Notes, do understand).

I realized that for my problem, where the copy paste was not working at all, neither select or select all on ios, the oroblem was the old webview, because I tried uograding to the new webview just to test this and it worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

icchio picture icchio  Â·  3Comments

ghost picture ghost  Â·  3Comments

goleary picture goleary  Â·  3Comments

wwallace picture wwallace  Â·  4Comments

mateo666 picture mateo666  Â·  3Comments