InstalogIOS is a powerful SDK for iOS applications that provides crash reporting, event logging, and user feedback collection capabilities.
InstalogIOS is available through CocoaPods. To install it, add the following line to your Podfile:
pod 'InstalogIOS'InstalogIOS is also available through Swift Package Manager. To install it, add the following to your Package.swift file:
dependencies: [
.package(url: "https://github.com/instalog-dev/instalog-ios.git", .exact("1.0.1"))
]Or in Xcode:
- File > Add Packages...
- Enter package URL:
https://github.com/instalog-dev/instalog-ios.git - Select "Exact Version" and enter "1.0.1"
- Click "Add Package"
import InstalogIOS
// In AppDelegate
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Basic initialization
Instalog.shared.initialize(key: "your-api-key")
// Or initialize with specific features enabled/disabled
let options = InstalogOptions(dictionary: [
"isCrashEnabled": true, // Enable/disable crash reporting
"isFeedbackEnabled": true, // Enable/disable feedback functionality
"isLogEnabled": true, // Enable/disable event logging
"isLoggerEnabled": false // Enable/disable debug logging
])
Instalog.shared.initialize(key: "your-api-key", options: options)
return true
}InstalogIOS allows you to configure which features are enabled or disabled:
| Option | Default | Description |
|---|---|---|
isCrashEnabled |
true |
Controls crash reporting functionality |
isFeedbackEnabled |
true |
Controls in-app feedback functionality |
isLogEnabled |
true |
Controls event logging functionality |
isLoggerEnabled |
false |
Controls internal debug logging |
You can configure these options when initializing the SDK, or use the default configuration.
// Set user ID
Instalog.shared.identifyUser("user123")
// Log an event
let log = InstalogLogModel(
event: "onboarding_completed",
params: ["screen": "welcome", "user_type": "new"]
)
Instalog.shared.logEvent(log: log)
// Show feedback modal
Instalog.shared.showFeedbackModal()- Automatic crash detection
- Manual crash reporting
- Crash simulation for testing
- Can be enabled/disabled through configuration
- Multiple log levels (debug, info, warning, error)
- Custom metadata support
- Automatic device information collection
- Can be enabled/disabled through configuration
- In-app feedback modal
- Screenshot attachment (up to 4 images)
- Programmatic feedback submission
- Can be enabled/disabled through configuration
- Selectively enable or disable features based on your needs
- Control internal logging verbosity
- All configurations can be set at initialization
To run the example project:
- Clone the repo
- Run
pod installfrom the Example directory - Open the workspace in Xcode
The example project demonstrates:
- SDK initialization with feature configuration
- Event logging with different log levels
- Crash reporting and simulation
- User feedback collection
// Initialize with all default settings
Instalog.shared.initialize(key: "your-api-key")
// Initialize with custom configuration
let options = InstalogOptions(dictionary: [
"isCrashEnabled": true,
"isFeedbackEnabled": true,
"isLogEnabled": true,
"isLoggerEnabled": true // Enable internal logging for debugging
])
Instalog.shared.initialize(key: "your-api-key", options: options)
// Set a user identifier
Instalog.shared.identifyUser("user_123")// Simple event log
let simpleLog = InstalogLogModel(
event: "product_viewed",
params: ["product_id": "12345", "category": "electronics"]
)
Instalog.shared.logEvent(log: simpleLog)
// Detailed event log
let detailedLog = InstalogLogModel(
event: "payment_failed",
params: [
"transaction_id": "tx_789",
"error_code": "payment_declined",
"amount": "99.99",
"currency": "USD"
]
)
Instalog.shared.logEvent(log: detailedLog)Ogbonda Chiziaruhoma
chiziaruhoma@gmail.com
InstalogIOS is available under the MIT license. See the LICENSE file for more info.