Example #1
0
        public bool SendFilesRequest(out NSError error, string appId)
        {
            string  filename1  = "first.txt";
            NSData  data1      = new NSString("This is first.txt, the first test file to send.").Encode(NSStringEncoding.UTF8);
            NSError file1Error = null;
            bool    written    = GDFileSystem.WriteToFile(data1, filename1, out file1Error);

            if (!written)
            {
                Debug.WriteLine(String.Format("Error writing to {0}", filename1));
                error = null;
                return(false);
            }


            string  filename2  = "second.txt";
            NSData  data2      = new NSString("This is second.txt, the second test file to send.").Encode(NSStringEncoding.UTF8);
            NSError file2Error = null;

            written = GDFileSystem.WriteToFile(data2, filename2, out file2Error);

            if (!written)
            {
                Debug.WriteLine(String.Format("Error writing to {0}", filename2));
                error = null;
                return(false);
            }

            NSObject[] files = new NSObject[2] {
                new NSString(filename1), new NSString(filename2)
            };
            string requestId;

            return(GDServiceClient.SendTo(appId, kGreetingsServiceId, "1.0.0", "sendFiles", null, files, GDTForegroundOption.EPreferPeerInForeground, out requestId, out error));
        }
        public bool SendSaveEditFileRequest(out NSError error, string appId, NSDictionary parameters,
                                            string[] attachments, string method)
        {
            var requestId = string.Empty;

            return(GDServiceClient.SendTo(appId, "com.good.gdservice.save-edited-file", "1.0.0.0",
                                          method, parameters, attachments.Select(a => new NSString(a)).ToArray(),
                                          GDTForegroundOption.EPreferPeerInForeground,
                                          out requestId, out error));
        }
Example #3
0
        public bool SendGetDateAndTimeRequest(out NSError error, string appId)
        {
            string requestId;

            return(GDServiceClient.SendTo(appId, kDateAndTimeServiceId, "1.0.0", "getDateAndTime", null, null, GDTForegroundOption.EPreferMeInForeground, out requestId, out error));
        }