Coder Social home page Coder Social logo

albale221171 / cloudrail-si-xamarin-ios-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from repoforks/cloudrail-si-xamarin-ios-sdk

0.0 2.0 0.0 978.82 MB

Unified API Library for: Cloud Storage, Social Log-In, Social Interaction, Payment, Email, SMS, POIs, Video & Messaging. Included services are Dropbox, Google Drive, OneDrive, OneDrive for Business, Box, Egnyte, PayPal, Stripe, Google Places, Foursquare, Yelp, YouTube, Vimeo, Twitch, Facebook Messenger, Telegram, Line, Viber, Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Mailjet, Sendgrid, Twilio, Nexmo, Twizo.

Home Page: https://cloudrail.com

cloudrail-si-xamarin-ios-sdk's Introduction

Click for Xamarin.Android Version

CloudRail SI for Xamarin iOS

Integrate Multiple Services With Just One API

CloudRail is an API integration solution which abstracts multiple APIs from different providers into a single and universal interface.

Current Interfaces:

---

Full documentation can be found at our website.

Learn more about CloudRail on https://cloudrail.com



With CloudRail, you can easily integrate external APIs into your application. CloudRail provides abstracted interfaces that take several services and then exposes a developer-friendly API that uses common functions between all providers. This means that, for example, Upload() works in exactly the same way for Dropbox as it does for Google Drive, OneDrive, and other Cloud Storage Services, and GetEmail() works similarly the same way across all social networks.

Download Nuget Package or DLL and Basic setup

You can download CloudRail SDK Nuget Package from: https://www.nuget.org/packages/Xamarin.CloudRail.iOS

Or just download and add the DLL cloudrail-si-xamarin-ios-sdk.dll file to your project reference. In the Project Navigator, open the source file of your application delegate. Add the import statement at the top of the file, then add the following call to CloudRail in the didFinishLaunching or didFinishLaunchingWithOptions method of your app delegate:

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

Get your license key here


Current Interfaces:

Interface Included Services
Cloud Storage Dropbox, Google Drive, OneDrive, Box, pCloud, Egnyte, OneDrive Business
Business Cloud Storage Amazon S3, Microsoft Azure, Rackspace, Backblaze
Social Profiles Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Instagram, Heroku
Social Interaction Facebook, Twitter
Payment PayPal, Stripe
Email Maljet, Sendgrid, Gmail
SMS Twilio, Nexmo
Point of Interest Google Places, Foursquare, Yelp
Video Youtube, Twitch, Vimeo
Messaging Facebook Messenger, Telegram, Line, Viber, SlackBot

Cloud Storage Interface:

  • Dropbox
  • Box
  • Google Drive
  • Microsoft OneDrive
  • pCloud
  • Egnyte
  • OneDrive Business

Features:

  • Download files from Cloud Storage.
  • Upload files to Cloud Storage.
  • Upload files with modified date to Cloud Storage.
  • Get Meta Data of files, folders and perform all standard operations (copy, move, etc) with them.
  • Retrieve user and quota information.
  • Generate share links for files and folders.

Code Sample

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";


ICRCloudStorageProtocol> service;

// Setup Google Drive Authenticating: https://blog.cloudrail.com/authenticating-google-drive/
// CRGoogleDrive drive = new CRGoogleDrive("[clientIdentifier]", "", "[redirectUri]", "[state]");
// drive.UseAdvancedAuthentication();
// service = drive;


// service = new CRBox("[clientIdentifier]", "[clientSecret]");
// service = new CROneDrive("[clientIdentifier]", "[clientSecret]");
// service = new CRPCloud("[clientIdentifier]", "[clientSecret]");


//Setup Dropbox Authenticating: https://blog.cloudrail.com/authenticating-with-dropbox/
CRDropbox dropbox = new CRDropbox("[clientIdentifier]", "[clientSecret]", "https://auth.cloudrail.com/YourBundleID", "someState");
dropbox.UseAdvancedAuthentication();
service = dropbox;

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
            NSInputStream object = service.DownloadFileWithPath:@"/mudkip.jpg"];
	}
	catch (Exception e)
	{
	    Console.WriteLine(e.Message);
	}

})).Start();

//READ FROM STREAM

Business/Bucket Cloud Storage Interface:

  • Amazon Web Services S3
  • Microsoft Azure
  • Rackspace
  • Backblaze

Features

  • Create, delete and list buckets
  • Upload files
  • Download files
  • List files in a bucket and delete files
  • List files in a with prefix
  • Get file metadata (last modified, size, etc.)

Code Sample

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICRBusinessCloudStorageProtocol service;

// service = new CRMicrosoftAzure("[accountName]", "[accessKey]");
// service = new CRRackspace("[username]", "[apiKey]", "[region]");
// service = new CRBackblaze("[accountId]", "[appKey]");
// service = new CRGoogleCloudPlatform("[clientEmail]", "[privateKey]", "[projectId]");

service = new AmazonS3("[accessKeyId]", "[secretAccessKey]", "[region]");

CRBucket bucket = new CRBucket();
bucket.Name = "bucket_name";
bucket.Identifier = "bucket_id";
NSData data = //data source;
var len = (int)data.Length
NSInputStream inputStream = new NSInputStream(data)

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
           service.UploadFileToBucket(bucket,"file_name",inputStream,len);
	}
	catch (Exception e)
	{
	   Console.WriteLine(e.Message);
	}

})).Start();

Social Media Profiles Interface:

  • Facebook
  • Github
  • Google Plus
  • LinkedIn
  • Slack
  • Twitter
  • Windows Live
  • Yahoo
  • Instagram
  • Heroku

Features

  • Get profile information, including full names, emails, genders, date of birth, and locales.
  • Retrieve profile pictures.
  • Login using the Social Network.

Code Sample

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICRProfileProtocol service;

// Google Plus:
// CRGooglePlus gPlus = new CRGooglePlus("[clientIdentifier]", "", "[redirectUri]", "[state]");
// gPlus.UseAdvancedAuthentication();
// service = gPlus;


// service = new CRGitHub("[clientIdentifier]", "[clientSecret]");
// service = new CRSlack("[clientIdentifier]", "[clientSecret]");
// service = new CRInstagram("[clientIdentifier]", "[clientSecret]");
// ...

service = new CRFacebook("[clientIdentifier]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       string email = service.GetEmail();
       string fullname = service.GetFullName();
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Social Media Interaction Interface:

  • Facebook
  • Twitter

Features

  • Get a list of connections.
  • Make a post for the user.

Code Sample

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICRSocialProtocol service;

// service = new CRTwitter("[clientID]", "[clientSecret]");
// service = new CRFacebook("[pageName]", "[clientID]", "[clientSecret]");
service = new CRFacebook("[clientID]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
           service.PostUpdateWithContent("Using Cloudrail sdk!");
	}
	catch (Exception e)
	{
	   Console.WriteLine(e.Message);
	}

})).Start();

Payment Interface:

  • PayPal
  • Stripe

Features Interface

  • Perform charges
  • Refund previously made charges
  • Manage subscriptions

Code Sample

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICRPaymentProtocol service;

// service = new CRPayPal(true, "[clientIdentifier]", "[clientSecret]");

service = new CRStripe("[secretKey]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
           CRSubscriptionPlan subPlan = service.CreateSubscriptionPlanWithName("Plan name",2000,"USD","description","day",7);
	}
	catch (Exception e)
	{
	   Console.WriteLine(e.Message);
	}

})).Start();

Email Interface:

  • Mailjet
  • Sendgrid
  • Gmail

Features

  • Send Email

Code Sample

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICREmailProtocol service;

// service = new CRMailJet("[clientIdentifier]", "[clientSecret]");
// service = new CRGMail("[GMail Client Identifier]","","com.cloudrail.example:/auth","someState");

service = new CRSendGrid("API Key");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
       	   NSMutableArray<NSString> toAddresses = new NSMutableArray<NSString>();
           toAddresses.Add(new NSString("[email protected]"));
           toAddresses.Add(new NSString("[email protected]"));
	   
	   CRAttachment attachImage = new CRAttachment(content,"image/jpg","MyFile.jpg"); //InputStream, MimeType,FileName
	   
	   NSMutableArray<CRAttachment> attachments = new NSMutableArray<CRAttachment>();
	   attachments.Add(attachImage);

       	   service.SendEmail("[email protected]", @"Bob", toAddresses, "Mailjet and SendGrid", "The Mailjet and Sendgrid is on cloudrail now!!!","", null, null, attachments);
	}
	catch (Exception e)
	{
	   Console.WriteLine(e.Message);
	}

})).Start();

SMS Interface:

  • Twilio
  • Nexmo
  • Twizo

Features

  • Send SMS

Code Sample

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICRSMSProtocol service;

// service = new CRNexmo("[clientIdentifier]", "[clientSecret]");
service = new CRTwilio("[clientIdentifier]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       service.SendSMS("CloudRail", "+4912345678", "Hello from CloudRail");
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Points of Interest Interface:

  • Google Places
  • Foursquare
  • Yelp

Features

  • Get a list of POIs nearby
  • Filter by categories or search term

Code Example

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICRPointsOfInterestProtocol service;

// service = new CRYelp("[consumerKey]", "[consumerSecret]", "[token]", "[tokenSecret]");
// service = new CRGooglePlaces("[apiKey]");

service = new CRFoursquare("[clientID]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
      	   NSMutableArray arrayPOI = service.NearbyPoisWithLatitude(9.483927, 8.473272, 300, "", null);
	   CRPOI[] pois = NSArray.FromArray<CRPOI>(arrayPOI);
	}
	catch (Exception e)
	{
	   Console.WriteLine(e.Message);
	}

})).Start();

Video Interface:

  • Youtube
  • Twitch
  • Vimeo

Features

  • Search for videos
  • Upload videos
  • Get a list of videos for a channel
  • Get channel details
  • Get your own channel details
  • Get video details

Code Example

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICRVideoProtocol service;

// service = new CRTwitch("[Twitch Client Identifier]", "[Twitch Client Secret]");
// service = new CRVimeo("[Vimeo Client Identifier]", "[Vimeo Client Secret]");

service = new CRYouTube("[YouTube Client Identifier]", "", "com.cloudrail.example:/auth", "someState");
service.UseAdvancedAuthentication();

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
      	   CRVideoMetaData[] result = NSArray.FromArray<CRVideoMetaData>(service.SearchVideosWithQuery("Game of Thrones",0,20));  //Query, Offset, Limit
	   
	   //CRVideoMetaData result = service.UploadVideoWithTitle("HowTo: Setup CloudRail","Video about Setting up CloudRail", NSInputStream, 1448576, "UCnrFDdA2KAItbRzm2a3I_OA", "video/mp4"); // Title, Description, Stream (data), Size, ChannelID (optional for Youtube) and Video Mime type
	  
	   
	}
	catch (Exception e)
	{
	   Console.WriteLine(e.Message);
	}

})).Start();

Messaging Interface:

  • FacebookMessenger
  • Telegram
  • Line
  • Viber

Features

  • Send text messages
  • Send files, images, videos and audios
  • Parse a message received on your webhook
  • Download the content of an attachment sent to your webhook

Code Example - Objective-C

Full Documentation

using CloudRailSI;

CRCloudRail.AppKey = "{Your_License_Key}";

ICRMessagingProtocol service;

// service = new CRViber("[Bot Token]", "[Webhook URL]", "[Bot Name]");
// service = new CRTelegram("[Bot Token]", "[Webhook URL]");
// service = new CRLine("[Bot Token]");

service = = new CRFacebookMessenger("[Bot Token]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
	    CRMessage result = service.SendMessageWithReceiverId("12123242","It's so easy to send message via CloudRail");
	    Console.WriteLine(result);
	}
	catch (Exception e)
	{
	   Console.WriteLine(e.Message);
	}

})).Start();

Advance Request

//GET METHOD

CRAdvancedRequestSpecification req = new CRAdvancedRequestSpecification("/people/~:(positions,public-profile-url)?format=json");
req.Method = @"GET";
req.Headers = new Foundation.NSMutableDictionary();;
req.SetBodyAsString("");
CRAdvancedRequestResponse res = service.AdvancedRequestWithSpecification(req);
Console.WriteLine(res.BodyAsString);

More interfaces are coming soon.

Advantages of Using CloudRail

  • Consistent Interfaces: As functions work the same across all services, you can perform tasks between services simply.

  • Easy Authentication: CloudRail includes easy ways to authenticate, to remove one of the biggest hassles of coding for external APIs.

  • Switch services instantly: One line of code is needed to set up the service you are using. Changing which service is as simple as changing the name to the one you wish to use.

  • Simple Documentation: There is no searching around Stack Overflow for the answer. The CloudRail documentation at https://cloudrail.com/integrations is regularly updated, clean, and simple to use.

  • No Maintenance Times: The CloudRail Libraries are updated when a provider changes their API.

  • Direct Data: Everything happens directly in the Library. No data ever passes a CloudRail server.

Sample Applications

If you don't know how to start or just want to have a look at how to use our SDK in a real use case, we created a few sample application which you can try out:

License Key

CloudRail provides a developer portal which offers usage insights for the SDKs and allows you to generate license keys.

It's easy to sign up and generate a key.

Head over to https://cloudrail.com/signup

Pricing

Learn more about our pricing on https://cloudrail.com/pricing

Other Platforms

CloudRail is also available for other platforms like iOS, Java and NodeJS. You can find all libraries on https://cloudrail.com

Questions?

Get in touch at any time by emailing us: [email protected]

or

Tag a question with cloudrail on StackOverflow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.