Coder Social home page Coder Social logo

isabella232 / ios-objectivec-imagediscovery-rest-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoftgraph/ios-objectivec-imagediscovery-rest-sample

0.0 0.0 0.0 5.71 MB

The Microsoft Graph Image Discovery sample allows you to take or search for an image and save it to OneDrive, or mail it to a recipient.

License: MIT License

Objective-C 99.45% Ruby 0.55%

ios-objectivec-imagediscovery-rest-sample's Introduction

[ARCHIVED] Office 365 Microsoft Graph Image Discovery for iOS

IMPORTANT

This project is being archived. As part of the archival process, we're closing all open issues and pull requests.

You can continue to use this sample "as-is", but it won't be maintained moving forward. We apologize for any inconvenience.

Overview

Image Discovery is an iOS sample app that allows you either to take a picture or to search the web for one, and process the fetched image. You can then save it in the cloud or mail to a recipient. For example, you can take a picture, convert the image to black and white, and push it to OneDrive for Business to store.

Camera

Or, you can search for an image via Google Custom Search and mail it to a friend.

Search

This sample illustrates how to use Microsoft Graph, a unified API endpoint, for working with mail and files in Office 365. For more information about Microsoft Graph see the Microsoft Graph overview page.

Prerequisites

  • Xcode from Apple

  • Installation of CocoaPods as a dependency manager.

  • An Office 365 account. You can sign up for an Office 365 Developer subscription that includes the resources that you need to start building Office 365 apps.

    Note: If you already have a subscription, the previous link sends you to a page with the message Sorry, you can’t add that to your current account. In that case, use an account from your current Office 365 subscription.Mic

  • A Microsoft Azure Tenant to register your application. Microsoft Azure Active Directory (AD) provides identity services that applications use for authentication and authorization. A trial subscription can be acquired here: Microsoft Azure.

    Important: You'll also need to ensure your Azure subscription is bound to your Office 365 tenant. To do this, see the Active Directory Team's Blog post, Creating and Managing Multiple Windows Azure Active Directories. The Adding a new directory section will explain how to do this. You can also see Set up your Office 365 development environment and the section Associate your Office 365 account with Azure AD to create and manage apps for more information.

  • A client id (application id) and redirect uri values of an application registered in Azure. This sample application must be granted several permissions for Microsoft Graph. To create the registration, see Grant permissions to the Snippets application in Azure.

  • This sample uses Google Custom Search to search for images. In order for the search functionality in this app to work, you'll need your own API key and custom search engine ID (cx). For more information about obtaining these values see Google Custom Search.

    Note: The search functionality in this app is reliant on getting the API Key and search engine ID. The camera workflow, for getting an image, will still function without this information, but again you'll need these values for the search component in the app to work. Also, Google Custom Search is just being used as an example; you can implement other search engine options as needed.

Running this sample in Xcode

  1. Clone this repository

  2. Use CocoaPods to import the Active Directory Authentication Library (ADAL) iOS dependency:

      pod 'AFNetworking', ' ~> 3.0'
      pod 'ADALiOS'
    

This sample app already contains a podfile that will get the ADAL components (pods) into the project. Simply navigate to the project from Terminal and run:

    pod install

For more information, see Using CocoaPods in Additional Resources

  1. Open ImageDiscovery.xcworkspace

  2. Open AuthenticationConstants.m. You'll see that the ClientID (this is the application id from the registration process) and RedirectUri values can be added to the top of the file. Also you'll need to provide the Google API Key and the custom search engine ID (cx) for the search functionality to work. Supply the necessary values here:

     // You will set your application's Client ID and Redirect URI.
     NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
     NSString * const kClientId    = @"ENTER_YOUR_CLIENT_ID";
     NSString * const kResourceId  = @"https://graph.microsoft.com";
     NSString * const kAuthority   = @"https://login.microsoftonline.com/common";
     
     // To enable image search in the app, you'll need to supply the API Key and 
     // custom search engine ID (cx) after registering for Google Images.
     NSString * const kGoogleAPIKey = @"ENTER_Google_API_KEY";
     NSString * const kGoogleCX     = @"ENTER_Google_CX";
    
  3. Run the sample.

Contributing

If you'd like to contribute to this sample, see CONTRIBUTING.MD.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Questions and comments

We'd love to get your feedback about the Office 365 iOS Microsoft Graph Image Discovery project. You can send your questions and suggestions to us in the Issues section of this repository.

Questions about Office 365 development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [Office365] and [MicrosoftGraph].

Additional resources

Copyright

Copyright (c) 2016 Microsoft. All rights reserved.

ios-objectivec-imagediscovery-rest-sample's People

Contributors

andrewjmay avatar bmitchell287 avatar jackson-woods avatar ricalo avatar unpluggedk avatar

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.