Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6342] Issue saving to clipboard

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2019-09-26T22:51:49.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
Reportereric harms
AssigneeShak Hossain
Created2019-08-22T17:58:32.000+0000
Updated2019-09-26T22:51:50.000+0000

Description

Hi, I'm having some issues saving an item to the clipboard (string). Please see below for the code Im using (taken directly from https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Clipboard) and the errors Im receiving. Im firing the code with a click event on a label. I understand I am not using a GA version of the Ti SDK, but it's necessary as this version solved some issues that 8.1.0 does not solve. Im not having any other issues, otherwise. Thanks!
Ti.UI.Clipboard.setItems({
	items: [{
		"text/plain": "John",
	},{
		"text/plain": "Doe"
	}]
});

LOG(Ti.UI.Clipboard.getItems())

[ERROR] Script Error {
[ERROR]     column = 22;
[ERROR]     line = 205;
[ERROR]     message = "undefined is not an object (evaluating 'Ti.UI.Clipboard.setItems')";
[ERROR]     stack = "    at )";
[ERROR]     toJSON = "<KrollCallback: 0x2852ac540>";
[ERROR] }

var clipboard = Ti.UI.createClipboard({
	unique : true
});
clipboard.setText('hello');
Ti.API.info('clipboard name is: ' + clipboard.name);
Ti.API.info('clipboard.getText() ' + clipboard.getText());

[ERROR] Script Error {
[ERROR]     column = 44;
[ERROR]     line = 205;
[ERROR]     message = "invalid method (createClipboard) passed to UIModule";
[ERROR]     nativeStack = "3   CoreFoundation  0x0000000227012414 <redacted> + 148\n4   CoreFoundation  0x0000000226eee5b8 <redacted> + 324\n5   TitaniumKit0x00000001065f09b8 -[KrollMethod call:] + 664\n6   TitaniumKit0x00000001065efdc8 __KrollCallAsFunction_block_invoke + 36\n7   TitaniumKit0x00000001065efbc4 KrollCallAsFunction + 424\n8   JavaScriptCore  0x000000022e5397a4 <redacted> + 360\n9   JavaScriptCore  0x000000022eb28ea4 <redacted> + 436\n10  JavaScriptCore  0x000000022e50ce30 <redacted> + 88064\n11  JavaScriptCore  0x000000022e4f73a4 <redacted> + 276\n12  JavaScriptCore  0x000000022ea4900c <redacted> + 424\n13  JavaScriptCore  0x000000022ec49a14 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 196\n14  JavaScriptCore  0x000000022e53ffe4 JSObjectCallAsFunction + 384\n15  TitaniumKit0x00000001065cdd8c TiBindingEventProcess + 680\n16  TitaniumKit0x00000001065edd14 -[KrollContext invoke:] + 116\n17  TitaniumKit0x00000001065edd84 -[KrollContext enqueue:] + 92\n18  TitaniumKit0x00000001065f588c TiBindingRunLoopEnqueue + 92\n19  TitaniumKit0x00000001065f40d0 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 168\n20  TitaniumKit0x00000001065d5788 -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 240\n21  TitaniumKit0x00000001065c6520 -[TiUIView touchesEnded:withEvent:] + 116\n22  UIKitCore  0x000000025403bd58 <redacted> + 7972";
[ERROR]     stack = "    at [native code]\n    at )";
[ERROR]     toJSON = "<KrollCallback: 0x281658180>";

Comments

  1. Rakhi Mitro 2019-09-09

    Hello, Thanks for sharing with is. Can you please test this issue on 8.1.1.GA and let us know the results?
  2. Sharif AbuDarda 2019-09-20

    Hello [~capsizeno4], I can't validate your issue in SDK 8.1.1.GA. Ti.UI.createClipboard does work. Use the latest SDK. Can you share a full sample code or in your case a demo of the issue in a video. Thanks.

JSON Source