ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP4126Integrated Apps Email …
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP4126

    Mobile Application Development 2

    Progress0 / 38 done
    Topics38
    1Understanding Xcode2Using the Xcode interface builder and objects library3Understanding view hierarchy and creating a custom app icon
    4Understanding outlets and actions5Using text fields, buttons, labels, web views, and page controllers6Using views with subviews and creating views using code
    7Working with the single view template8Exploring the app delegate and adding new view controllers9Transitioning between multiple view controllers using animations
    10Tabbar and master detail templates
    11Customizing for different inputs12Adjusting text field behaviors and dismissing the keyboard13Detecting keyboard activities with notification center14Using scroll view and responding to keyboard activities programmatically
    15Detecting device hardware16Dynamically adjusting graphical layouts and creating universal apps
    17Understanding UITableView and UITableViewCell18Working with UITableView data source and delegate19Master detail template, drill-down menus, and navigation20Using property lists for data persistence and creating multi-section tables
    21Portrait and landscape modes22Handling device rotation and forcing specific orientation23Dynamically adjusting layouts based on rotation
    24Importing sqlite3 and creating a database25Writing tables, inserting records, and bundling a database with your app26Checking for database existence and reading/displaying data
    27NSTimer class and object transformations28Rotation, scaling, translation, animating image arrays, and playing video
    29Email, Safari, and SMS30Working with camera and photo library
    31Consuming and parsing XML and JSON32Integrating Twitter and Facebook with iOS apps
    33MapKit and MKMapView34Getting and displaying user location and directional information35Displaying map annotations, disclosure buttons, and reverse geocoding36Working with iCloud
    37Gyroscope and accelerometer38Outputting sensor data and using the Shake API
    3 min read
    Topic 29 of 38
    Topic Study Note Illustration
    29

    Accessing Integrated iOS Apps: Email, Safari, and SMS

    In iOS development, integrated apps access means allowing your app to open and interact with built-in iOS applications such as:

    πŸ“± Accessing Integrated iOS Apps: Email, Safari, and SMS (iOS – Xcode)


    βœ… 1. Definition

    In iOS development, integrated apps access means allowing your app to open and interact with built-in iOS applications such as:

    • πŸ“§ Mail (Email app)
    • 🌐 Safari (Web browser)
    • πŸ’¬ Messages (SMS app)

    πŸ‘‰ This is done using URL Schemes and system frameworks like UIKit.


    🧠 2. Key Concepts

    πŸ”Ή URL Scheme

    A special type of URL used to open system apps.

    Examples:

    • mailto: β†’ Email
    • https:// β†’ Safari
    • sms: β†’ Messages

    πŸ”Ή UIApplication

    Used to open external apps from your app:

    UIApplication.shared.open(URL)
    

    πŸ“§ 3. Opening Email App (Mail)


    πŸ”Ή Basic Email Format

    mailto:example@gmail.com
    

    πŸ”Ή Send Email with Subject & Body

    let email = "test@gmail.com"
    let subject = "Hello"
    let body = "This is a test email"
    
    let emailString = "mailto:\(email)?subject=\(subject)&body=\(body)"
    let url = URL(string: emailString)!
    
    UIApplication.shared.open(url)
    

    🌐 4. Opening Safari (Web Browser)


    πŸ”Ή Open Website

    let url = URL(string: "https://www.google.com")!
    UIApplication.shared.open(url)
    

    πŸ”Ή Why Safari is Used?

    • Display web pages
    • Open external links
    • Load online content

    πŸ’¬ 5. Sending SMS (Messages App)


    πŸ”Ή Basic SMS Format

    sms:1234567890
    

    πŸ”Ή Send SMS with Message Body

    let phoneNumber = "1234567890"
    let message = "Hello from my app"
    
    let smsString = "sms:\(phoneNumber)&body=\(message)"
    let url = URL(string: smsString)!
    
    UIApplication.shared.open(url)
    

    πŸ“Š 6. Integration Flow Diagram

    iOS App
       ↓
    URL Scheme (mailto / https / sms)
       ↓
    UIApplication.shared.open()
       ↓
    System App Opens (Mail / Safari / Messages)
    

    πŸ’‘ 7. Example App

    🎯 Contact App

    • Button 1 β†’ Send Email
    • Button 2 β†’ Open Website
    • Button 3 β†’ Send SMS

    πŸ‘‰ User taps button β†’ system app opens automatically


    πŸ“Œ 8. Important Rules / Tips

    • Always validate URLs before opening
    • Use UIApplication.shared.open()
    • Encode spaces in URLs properly
    • Some features require real device testing (SMS)
    • Safari opens web content only with https://

    ⚠️ 9. Common Mistakes

    • ❌ Invalid URL format
    • ❌ Not encoding spaces in message
    • ❌ Testing SMS on simulator (won’t work)
    • ❌ Forgetting https:// in Safari links
    • ❌ Force unwrapping nil URLs

    🧠 10. Best Practices

    • Use URL encoding for safety
    • Check if device can open URL:
    if UIApplication.shared.canOpenURL(url) {
        UIApplication.shared.open(url)
    }
    
    • Keep message content short
    • Test on physical device for SMS/email

    πŸ“ 11. Likely Exam Questions

    1. What are integrated iOS apps?
    2. How do you open Safari from an iOS app?
    3. What is a URL scheme?
    4. Write code to send an email from an app.
    5. How do you send SMS in iOS?
    6. What is the use of UIApplication.shared.open()?
    7. Differentiate mail, SMS, and Safari integration.
    8. Why is SMS not working in simulator?

    πŸ“š 12. Quick Revision Summary

    • iOS apps can open:

      • πŸ“§ Mail β†’ mailto:
      • 🌐 Safari β†’ https:
      • πŸ’¬ SMS β†’ sms:
    • Uses UIApplication.shared.open()

    • URL schemes connect apps

    • Works best on real devices

    • Useful for communication apps


    ← Previous topic 28
    Rotation, scaling, translation, animating image arrays, and playing video
    Next topic 30 β†’
    Working with camera and photo library

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    481words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Mobile Application Development 2