feat: introducing alt-tab pro!

BREAKING CHANGE: announcement: https://github.com/lwouis/alt-tab-macos/discussions/5533

* improved performance, especially switcher responsiveness
* reduced battery usage even more
* reduced ram usage (closes #5450, closes #5539, closes #5627)
* reduced app size even more
* polished many aspects of the ui; align more with liquid glass
* better handle "ghost" windows (closes #5509)
* fix issue with wrong window order (closes #5492)
* escape closes the switcher on tahoe (closes #5585)
* improve search matches (closes #5488)
* localizations trimmed and reviewed entirely (closes #5583)
* highlight matching app icons when searching, in addition to text
* better settings import/export
* reworked "send feedback" experience
* reworked exceptions ui (closes #5482)
* per-shortcut settings (closes #5313)
* rework about window
This commit is contained in:
lwouis
2026-04-05 22:18:45 +02:00
parent 317a485bcb
commit 9147a4a864
1868 changed files with 76272 additions and 59710 deletions
+193
View File
@@ -0,0 +1,193 @@
---
name: assets-optimization
description: Audit and optimize every image asset shipped with AltTab. Apply the right format per asset class (PDF for vectors, HEIC for raster) and the right post-processing (strip Figma cruft from PDFs, extract SF Symbols as minimal vector PDFs, encode raster sources to HEIC at q50 with visual review). Use whenever new assets are added, when the bundle size needs shrinking, or whenever you want a full assets audit.
---
# /assets-optimization — AltTab asset audit and optimization
## Goal
Every byte that ships in `AltTab.app/Contents/Resources/` should justify itself. Vectors stay vector, rasters compress to HEIC, and neither carries metadata, color profiles, accessibility tags, or producer signatures that AppKit doesn't use.
This skill applies a known-good pipeline to each asset class. It is opinionated about the right format and the right encoder for each kind of content.
## When to use
- A designer drops new exports into `~/Desktop/` or `resources/`.
- Someone asks "why is the bundle so big?".
- After adding a new icon, illustration, app icon variant, or menubar variant.
- Periodic audit when nothing else is broken.
## Step 1: Inventory
Run a one-shot enumeration so you know what you're working with:
```sh
find resources -type f \( -iname '*.pdf' -o -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.heic' -o -iname '*.svg' -o -iname '*.icns' \) \
-exec ls -la {} \; | awk '{printf "%8d %s\n", $5, $9}' | sort -k2
```
Group what you see by directory. For AltTab the relevant buckets are:
- `resources/icons/menubar/` — small template icons shown in the macOS menubar.
- `resources/icons/tabs/` — Preferences sidebar icons (template, sized ~13pt).
- `resources/icons/permission-window/` — first-launch permission window icons (~32pt).
- `resources/icons/app/` — the macOS app icon (`.icns` + `.iconset/`). **Don't touch**`.icns` is required by the bundle and Apple's tooling produces near-optimal output already.
- `resources/illustrations/` — the appearance-tab preview thumbnails. Raster (screenshots inside).
For each asset, decide what category it falls into:
| Source content | Right format | Why |
|---|---|---|
| Custom vector design (Figma/Sketch/Illustrator) | **PDF** | macOS 10.13 doesn't accept SVG; PDF is the universal vector container AppKit reads natively. |
| SF Symbol (Apple system glyph) | **Font glyph** in the bundled `SF-Pro-Text-Regular.otf` subset | Render via `NSImage.fromSymbol(.foo, pointSize:)` (or as text via the `Symbols` enum). Smaller than per-icon PDFs, picks up Apple's latest glyph refinements automatically when the developer updates SF Symbols.app. |
| Photographic / screenshot-heavy | **HEIC** | HEIC at q50 beats JPEG by ~30% at the same perceptual quality. |
| Tiny pixel-precise UI sprite | **PNG @2x** | Below ~40×40px the PDF overhead exceeds the bitmap savings. PNG wins. |
| App icon (the macOS bundle one) | **`.icns`** | Required by `CFBundleIconFile`. |
If an asset is in the wrong format, flag it. If it's in the right format but unoptimized, run the matching pipeline below.
## Step 2: Vector PDFs — Figma exports
Figma's "Export → PDF" output is bloated. For each menubar/illustration/icon vector PDF that came from Figma, you can strip ~5075% of the bytes without losing a single rendered pixel.
What Figma adds that AppKit doesn't need:
1. **Embedded ICC color profile** (`/ICCBased ...`, ~3.2 KB compressed). Replace every `[/ICCBased N R]` reference with `/DeviceRGB` (or `/DeviceGray` for monochrome). Patches needed in:
- the page `Resources/ColorSpace` dict
- every Form XObject's `Resources/ColorSpace` dict (these are streams, not plain dicts — pikepdf's `pdf.objects` will only catch them if you accept both `Dictionary` and `Stream`)
- every Image XObject's direct `/ColorSpace` key
- every Shading dict inside `Pattern` entries (Figma's color icons use 8+ patterns, each with its own `/ColorSpace N R` reference)
2. **`/Metadata`** XMP packet (~830 B) — Figma's XML manifest.
3. **`/StructTreeRoot`, `/ParentTree`, `/StructElem`** — accessibility tags ("Document" / "Part" structural roles). AppKit's PDF renderer ignores them.
4. **`/Info` dict** — `Producer="Figma"`, `Title="Menubar 22x22@1x white"`. In Figma's exports the Info dict sometimes lives **inline inside the Catalog** rather than at the trailer level, so deleting `pdf.docinfo` isn't enough — also `del root[Name('/Info')]`.
5. **`/Lang`, `/MarkInfo`, `/Annots`, `/StructParents`, `/Tabs`** — empty or trivial page-level entries.
6. **`/ProcSet [/PDF]`** — deprecated since PDF 1.4.
Use the script:
```sh
python3 scripts/assets/optimize_figma_pdf.py resources/icons/menubar/*.pdf
```
It edits in place and prints the savings per file. After running, also pipe through `mutool clean -ggg -z` and `qpdf --object-streams=generate --recompress-flate --compression-level=9` for the final 12% squeeze.
Verify each file still renders by sips'ing it back to PNG and eyeballing:
```sh
for f in resources/icons/menubar/*.pdf; do
sips -s format png "$f" --out "/tmp/$(basename $f .pdf).png" -Z 300 >/dev/null 2>&1
done
```
Open the PNGs in Preview to confirm nothing visual changed.
## Step 3: SF Symbols via font subset
Every SF Symbol shipped in AltTab — switcher status icons, sidebar tab icons, button icons, permission/feedback icons — is rendered as a text glyph from a subsetted SF Pro Text font. There are no SF-Symbol PDFs in the bundle.
How it works: SF Symbols are glyphs in the Private Use Area of SF Pro Text. Apple's `SF-Pro-Text-Regular.otf` contains every symbol they've ever shipped. We subset it down to just the codepoints AltTab needs (currently ~36 glyphs, ~17 KB) into `resources/SF-Pro-Text-Regular.otf`, and register it via `Info.plist:ATSApplicationFontsPath = ""`. At runtime, `NSFont(name: "SF Pro Text", size:)` resolves to the bundled subset on macOS <11 (where the system font isn't installed) and to the system font on macOS 11+, with identical glyph appearance either way.
To add a new SF Symbol:
1. Open [SF Symbols.app](https://developer.apple.com/sf-symbols/), search for the symbol, press **Cmd-C** to copy the symbol character to the clipboard. (Apple's name→codepoint mapping is not exposed via public API, and the SF Pro Text font's cmap uses `uniXXXXXX.medium`-style names rather than semantic ones, so this manual lookup is the authoritative path.)
2. Paste the character into a new case on the `Symbols` enum in [src/switcher/main-window/TileFontIconView.swift](src/switcher/main-window/TileFontIconView.swift) — e.g., `case foo = "􀝥" // SF Symbol name`.
3. Paste the same character at the end of the `--text=` argument in [scripts/assets/subset_font.sh](scripts/assets/subset_font.sh).
4. Run `bash scripts/assets/subset_font.sh`. It reads `/Library/Fonts/SF-Pro-Text-Regular.otf` (installed by SF Symbols.app — a standard developer prerequisite) and writes the regenerated subset to `resources/SF-Pro-Text-Regular.otf`. Picks up Apple's latest glyph refinements automatically.
5. Use it in code: `NSImage.fromSymbol(.foo, pointSize: 14)` returns a template `NSImage`; or `TileFontIconView(symbol: .foo, ...)` for the cached-attributed-string path in the switcher hot loop.
The script runs `pyftsubset` via the project's pipenv environment. Warnings about `MERG`/`meta`/`trak` tables being dropped are normal — those tables aren't relevant to glyph rendering.
### Historical note: SF Symbols via PDF (deprecated, scripts removed)
A previous pipeline shipped each SF Symbol as a per-glyph PDF in `resources/icons/`. The pipeline lives only in git history now (`scripts/assets/export_sf_symbol_pdf.swift` was deleted alongside the migrated PDFs). The technique is worth knowing in case a future need arises (e.g., a multi-color symbol that fonts can't represent):
- The naive route — `NSImage(systemSymbolName:).draw(in:)` against a PDF `CGContext` — produces a **black rectangle**, because Quartz emits `image-mask + fill-rectangle` operators where the rectangle paints over the mask. AppKit bug at the PDF emission level; `paletteColors` config does not fix it.
- The working route was to extract the symbol's vector path directly via private selectors that have been stable across macOS 1115:
`NSImage(systemSymbolName:).representations[0] (NSSymbolImageRep) → .perform("vectorGlyph") (CUINamedVectorGlyph) → .perform("CGPath") (real CGPath)`.
- The CGPath lives in CUI's internal coordinate space (~2× display points, Y-down) — scale to fit the canvas and flip Y. Walk the path via `CGPath.applyWithBlock` and emit raw PDF operators (`m`, `l`, `c`, `h`, `f`). Non-zero winding fill. Fill with DeviceGray (`0 g`), **not** `NSColor.black.cgColor`, which drags in a ~3.4 KB ICC color profile.
- Final PDF wrapper: 4 objects (Catalog, Pages, Page, Content), no `/Info`, no `/Metadata`, no `/Resources/ColorSpace`. ~7501800 bytes per icon.
Git: see commit `990c1e79` ("feat: pro improve assets") for the PDF pipeline as-it-was; subsequent commit migrated the SF-Symbol PDFs back to font glyphs.
## Step 4: Raster → HEIC at q50
For anything raster (illustration thumbnails, screenshots inside an icon, anything photographic), HEIC at quality 50 is the baseline. q50 is roughly 50% smaller than JPEG at perceptually-equivalent quality, and at the small display sizes used in this app the artifacts are invisible.
Pipeline (built-in to macOS via `sips`):
```sh
sips -Z 1000 -s format heic -s formatOptions 50 input.png --out output.heic
```
- `-Z 1000` resizes the longest edge to 1000px **preserving aspect ratio**. AltTab's illustration display is 500pt wide, so 1000px is the correct @2x ship size. Anything larger wastes bytes; anything smaller looks soft on Retina.
- `formatOptions 50` is the quality. q50 was chosen after a side-by-side comparison at q20/q35/q50/q65/q80 — q50 was the lowest setting where text in screenshots stayed legible and gradient backgrounds didn't band.
Use the script for batch conversion:
```sh
bash scripts/assets/encode_heic.sh ~/Desktop 1000 50
```
That walks all PNG/JPEG files in the source directory, resizes to longest-edge 1000px at q50 HEIC, writes outputs to `/tmp/heic-out/`.
### Visual review (mandatory)
Before swapping the new HEICs into `resources/`, **always** decode a representative sample back to PNG and visually compare against the source:
```sh
sips -s format png /tmp/heic-out/sample.heic --out /tmp/sample-decoded.png >/dev/null 2>&1
open /tmp/sample-decoded.png /Users/you/Desktop/sample.png
```
Pick the visually most demanding file from the batch — usually one with the most text or the strongest gradients. Confirm:
- No banding in flat color regions
- Text edges still crisp at native display size
- No haloing around anti-aliased edges
- Color rendition matches
If anything looks degraded, bump quality to q60 or q65 and re-batch. The user, not the script, is the final arbiter — show them the sample with sizes before committing.
### Bumping quality
If q50 isn't acceptable, the next quality steps are q60 and q65 — beyond that, returns diminish quickly. q80 is the previous default in this repo and roughly 2× the bytes of q50 for no visible improvement on AltTab's content.
## Step 5: pbxproj registration
Whenever you change the file extension of a resource (.jpg → .heic, .png → .pdf, etc.), update [alt-tab-macos.xcodeproj/project.pbxproj](alt-tab-macos.xcodeproj/project.pbxproj). The places that need patching:
1. **PBXBuildFile section** — comment + the comment inside `fileRef = ... /* name.ext */`.
2. **PBXFileReference section** — comment, `lastKnownFileType` (e.g. `image.pdf`, `image.heic`, `image.png`), and `path = "name.ext"`.
3. **PBXGroup section** — the file's entry inside its parent group's `children`.
4. **PBXResourcesBuildPhase section** — the entry in the main app target's `files`.
For pure extension swaps (no new files), `sed -i '' 's|old\.ext|new.ext|g'` plus a `lastKnownFileType` substitution covers it. For new files, generate new 24-char uppercase-hex object IDs (`python3 -c "import secrets; print(secrets.token_hex(12).upper())"`) and insert in all four places.
If you removed an asset entirely (file deleted from disk), delete its 4 entries from pbxproj — otherwise the build fails with "missing file" or ships dangling references.
## Step 6: Verify
```sh
bash ai/build.sh # must show ** BUILD SUCCEEDED **
bash ai/run.sh # launch the app and visually inspect every asset
```
Walk through every UI surface that loads an asset:
- Menubar icon (default + the two alternates from Preferences → General → Menubar icon)
- Preferences sidebar — 4 tab icons (SF Symbol on macOS 11+, bundled PDF below)
- Permissions window — open by revoking a permission
- Preferences → Appearance — illustration thumbnails change per show/hide row
Compare `git diff --stat` before committing. Asset replacements should net negative on bundle size.
## Reporting
After the run, report:
- File-by-file before/after sizes for everything that changed.
- Total bundle delta in KB.
- Any files left untouched and why (e.g., `app.icns` — bundle-required format).
- The encoder settings used (especially HEIC quality if not q50, so the next person knows).
- Anything the visual review revealed (e.g., "had to bump to q60 for `thumbnails_dark` because gradient banding at q50").
@@ -0,0 +1,75 @@
---
name: translate-missing-l10n
description: Translate missing l10n strings for AltTab using Claude's multilingual ability. Refreshes the source `Localizable.strings` from current Swift code, finds keys missing in each `<lang>.lproj/Localizable.strings`, translates them, then writes them back via `scripts/l10n/apply_translations.ts`.
---
# /translate-missing-l10n
## Project context
AltTab is a macOS app that helps switch between windows, similar to the Windows alt-tab experience. The strings to translate are mostly Settings UI — some tooltips, dialogs, and general user guidance.
## Target languages (20)
`de, ja, fr, es, zh-CN, pt-BR, nl, ko, it, pl, ar, zh-HK, vi, tr, sv, th, zh-TW, he, id, ru`
(`en` is the source — handled automatically by the apply step.)
## Translation guidelines
- **Format specifiers must be preserved exactly**: `%@`, `%d`, `%1$@`, `%2$@`, `\n`, `\t`. The number and order of specifiers in the translation must match the source. Positional and unindexed forms are interchangeable (`%@ %@``%1$@ %2$@`), but the count must match.
- **Do not translate proper nouns**: "AltTab", "macOS", "Mission Control", "Spaces", "Dock".
- **Do not translate modifier key names**: "Cmd", "Option", "Alt", "Shift", "Ctrl", "Control", "Fn", "Command".
- **Use Apple's official platform terminology** for the target locale where one exists. For example, prefer the term Apple uses in macOS System Settings for that locale ("Réglages" vs "Préférences" in French) over a literal translation.
- **Match the source brevity**. Settings strings are short; the translation should be short too. Prefer concise, idiomatic phrasing over literal grammatical completeness.
- **Match macOS tone**: neutral, direct, no exclamation marks unless the source has them.
- **Comments in the source file are engineer guidance, not user-visible text**. Use them to disambiguate meaning, but never include them in the translation.
## Workflow
1. **Refresh the source.** Run:
```sh
bash scripts/l10n/extract_l10n_strings.sh
```
This regenerates `resources/l10n/Localizable.strings` from the current Swift code via `genstrings`.
2. **Parse the source.** Read `resources/l10n/Localizable.strings`. Each entry has the shape:
```
/* engineer comment */
"key" = "value";
```
Build the ordered list of `(comment, key, value)` triples. The `value` for the source is usually identical to `key`, but may include positional indices (`%1$@`, `%2$@`) when there are multiple specifiers.
3. **Compute missing keys per language.** For each of the 20 target languages, read `resources/l10n/<lang>.lproj/Localizable.strings`. Each line is `"key" = "translation";`. A key is **missing** if it's present in the source but either (a) absent from the target file, or (b) present with an empty or whitespace-only value. Treat (b) the same as (a) — produce a real translation.
4. **Stop if nothing is missing.** Report and exit.
5. **Translate.** For each language, produce a translation for each missing key, applying the guidelines above. Do not invent keys; only translate keys that appear in the source. Group your work into batches of 510 languages per call to keep individual outputs manageable.
6. **Apply each batch.** Write the batch to a fresh file under `/tmp` (not committed) with this shape:
```json
{
"fr": { "About %@": "À propos de %@", "Quit": "Quitter" },
"ja": { "About %@": "%@について" }
}
```
Then run:
```sh
npx ts-node scripts/l10n/apply_translations.ts /tmp/batch-NN.json
```
The helper:
- Validates format specifiers — translations whose specifier set doesn't match the source value are rejected with a clear error and **not merged**.
- Always rewrites `en.lproj/Localizable.strings` from source **keys** (each entry written as `"key" = "key";` for symmetry) — no need to include `en` in your batch. This avoids leaking genstrings-rewritten values like `%1$@` into the English file when the original source key uses plain `%@`.
- Rewrites each `<lang>.lproj/Localizable.strings` using source order: existing translations are preserved, new translations merged in, and keys no longer in the source are pruned.
- Exits with code `2` if any entries were rejected.
7. **Handle rejections.** If `apply_translations.ts` reports format-specifier mismatches, fix those translations and re-run only the affected language(s) in a follow-up batch. Do not move on while rejections are outstanding.
## Reporting
After the run, report:
- Number of languages processed.
- Total translations produced and merged.
- Any entries you intentionally left untranslated (e.g., the source was already a proper noun) — list them so the user can decide.
- Any format-specifier rejections that required manual fixes.
+2 -1
View File
@@ -1,3 +1,4 @@
github: lwouis
patreon: alt_tab_macos
custom: ["paypal.com/donate/?hosted_button_id=ACYAC3UYCM7CN", "donate.stripe.com/4gw9D7bA3g3O0ikaEF"]
ko_fi: alt_tab
custom: ["paypal.com/donate/?hosted_button_id=ACYAC3UYCM7CN"]
+2 -2
View File
@@ -10,8 +10,6 @@ env:
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_P12_CERTIFICATE: ${{ secrets.APPLE_P12_CERTIFICATE }}
FEEDBACK_TOKEN: ${{ secrets.FEEDBACK_TOKEN }}
CLOUDFLARE_WEBHOOK: ${{ secrets.CLOUDFLARE_WEBHOOK }}
SPARKLE_ED_PRIVATE_KEY: ${{ secrets.SPARKLE_ED_PRIVATE_KEY }}
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
GITHUB_EVENT_AFTER: ${{ github.event.after }}
@@ -67,3 +65,5 @@ jobs:
body: ${{ steps.set_release_info.outputs.body }}
files: ${{ env.XCODE_BUILD_PATH }}/*.zip
- run: scripts/update_website.sh
env:
GH_TOKEN: ${{ secrets.WEBSITE_DISPATCH_TOKEN }}
+8 -3
View File
@@ -7,11 +7,16 @@ IDEWorkspaceChecks.plist
/node_modules/
/DerivedData/
/build/
/vendor/*/.build/
/vendor/*/.swiftpm/
/vendor/*/Package.resolved
.DS_Store
/docs/_site/
/docs/vendor/
codesign.conf
codesign.crt
codesign.key
codesign.p12
/.claude/worktrees/
/.claude/*
!/.claude/skills/
/config/local.xcconfig
/scripts/l10n/missing-translations.json
/ai/output/
+2 -2
View File
@@ -1,6 +1,6 @@
project: alt-tab-macos.xcworkspace
project: alt-tab-macos.xcodeproj
schemes:
- Release
index_exclude:
- Pods/**
- vendor/**
- src/api-wrappers/private-apis/**
-1
View File
@@ -2,7 +2,6 @@
# src/**/*.swift: Matches all .swift files in the src directory and all its subdirectories.
# !node_modules/**: Excludes all files in the node_modules directory and all its subdirectories.
Pods/**
Generated/**
**/PrivateApis.swift
+4
View File
@@ -8,3 +8,7 @@
# Workflow
- Copy commands from ai/build.sh and run them, to confirm compilation works after you're done with implementing a change
# License / Keychain invariant
- The app's Developer ID, TeamID, and bundle ID must remain stable across builds. Keychain items are tied to the code signature; changing any of these orphans every user's stored license key and forces mass re-activation. If a rotation is unavoidable, plan a migration first (e.g., a backup-restore handler, or `kSecAttrAccessGroup` with a stable group identifier).
- Do not introduce legacy `SecKeychain*` API or `kSecAccessControl` (biometric/PIN gating) into license code — both can trigger Keychain password prompts, which is bad UX for license activation.
+52 -28
View File
@@ -2,55 +2,79 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ATSApplicationFontsPath</key>
<string></string>
<key>AppCenterApplicationForwarderEnabled</key>
<string>0</string>
<key>AppCenterSecret</key>
<string>#APPCENTER_SECRET#</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string>app.icns</string>
<!-- ===== Bundle identity (required by macOS / App Store) ===== -->
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>#VERSION#</string>
<key>CFBundleVersion</key>
<string>#VERSION#</string>
<key>FeedbackToken</key>
<string>#FEEDBACK_TOKEN#</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleIconFile</key>
<string>app.icns</string>
<key>NSHumanReadableCopyright</key>
<string>GPL-3.0 licence</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<!-- ===== Versioning (substituted from xcconfig; CI overrides via config/local.xcconfig) ===== -->
<key>CFBundleShortVersionString</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<!-- ===== Launch behavior (read by LaunchServices before app starts) ===== -->
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>LSUIElement</key>
<string>true</string>
<key>NSHumanReadableCopyright</key>
<string>GPL-3.0 licence</string>
<key>NSPrincipalClass</key>
<string>AppCenterApplication</string>
<key>NSSupportsAutomaticTermination</key>
<string>false</string>
<key>NSSupportsSuddenTermination</key>
<string>false</string>
<key>SUEnableAutomaticChecks</key>
<string>true</string>
<key>SUEnableJavaScript</key>
<string>true</string>
<key>SUFeedURL</key>
<string>https://alt-tab.app/appcast.xml</string>
<key>ATSApplicationFontsPath</key>
<string></string>
<!-- ===== URL scheme registration (LaunchServices dispatches $(PRODUCT_BUNDLE_IDENTIFIER):// to us) ===== -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleURLSchemes</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>
<!-- ===== Sparkle (auto-update framework — reads these directly from the bundle) ===== -->
<key>SUPublicEDKey</key>
<string>2e9SQOBoaKElchSa/4QDli/nvYkyuDNfynfzBF6vJK4=</string>
<key>SUEnableAutomaticChecks</key>
<string>true</string>
<key>SUScheduledCheckInterval</key>
<string>604800</string>
<!-- ===== AppCenter (crash reporter — read by AppCenterApplication superclass at init) ===== -->
<key>AppCenterApplicationForwarderEnabled</key>
<string>0</string>
<!-- ===== Build-time secrets (substituted from xcconfig; override per-dev via config/local.xcconfig) ===== -->
<key>AppCenterSecret</key>
<string>$(APPCENTER_SECRET)</string>
<key>Domain</key>
<string>$(DOMAIN)</string>
<key>ApiDomain</key>
<string>$(API_DOMAIN)</string>
</dict>
</plist>
-45
View File
@@ -1,45 +0,0 @@
# disable warnings coming from pods, which are always noise from our perspective
inhibit_all_warnings!
def deployment_target_from_xcconfig()
xcconfig_path = 'config/base.xcconfig'
File.foreach(xcconfig_path) do |line|
if line.start_with?('MACOSX_DEPLOYMENT_TARGET')
target = line.split("=").last.strip
puts "MACOSX_DEPLOYMENT_TARGET: #{target}"
return target
end
end
puts "\e[31mCouldn't read MACOSX_DEPLOYMENT_TARGET from #{xcconfig_path}\e[0m"
exit 1
end
deployment_target = deployment_target_from_xcconfig()
platform :osx, deployment_target
target 'alt-tab-macos' do
use_frameworks!
pod 'LetsMove', :git => 'https://github.com/lwouis/LetsMove.git', :commit => '7abf4daed1a25218f2b52f2dfd190aee5a50071c'
pod 'Sparkle', :podspec => 'https://raw.githubusercontent.com/lwouis/Sparkle/fix-iframe-popup-1.24/Sparkle.podspec'
pod 'ShortcutRecorder', :git => 'https://github.com/lwouis/ShortcutRecorder.git', :branch => 'alt-tab-current'
pod 'AppCenter/Crashes', '4.3.0'
pod 'SwiftyBeaver', '1.9.0'
end
target 'unit-tests' do
use_frameworks!
pod 'ShortcutRecorder', :git => 'https://github.com/lwouis/ShortcutRecorder.git', :branch => 'alt-tab-current'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# disable code signing which is unnecessary for pods
config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
# set deployment_target for all pods, to avoid libarclite compiler error
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = deployment_target
end
end
end
-49
View File
@@ -1,49 +0,0 @@
PODS:
- AppCenter/Core (4.3.0)
- AppCenter/Crashes (4.3.0):
- AppCenter/Core
- LetsMove (1.24)
- ShortcutRecorder (3.1)
- Sparkle (1.24.0)
- SwiftyBeaver (1.9.0)
DEPENDENCIES:
- AppCenter/Crashes (= 4.3.0)
- LetsMove (from `https://github.com/lwouis/LetsMove.git`, commit `7abf4daed1a25218f2b52f2dfd190aee5a50071c`)
- ShortcutRecorder (from `https://github.com/lwouis/ShortcutRecorder.git`, branch `alt-tab-current`)
- Sparkle (from `https://raw.githubusercontent.com/lwouis/Sparkle/fix-iframe-popup-1.24/Sparkle.podspec`)
- SwiftyBeaver (= 1.9.0)
SPEC REPOS:
trunk:
- AppCenter
- SwiftyBeaver
EXTERNAL SOURCES:
LetsMove:
:commit: 7abf4daed1a25218f2b52f2dfd190aee5a50071c
:git: https://github.com/lwouis/LetsMove.git
ShortcutRecorder:
:branch: alt-tab-current
:git: https://github.com/lwouis/ShortcutRecorder.git
Sparkle:
:podspec: https://raw.githubusercontent.com/lwouis/Sparkle/fix-iframe-popup-1.24/Sparkle.podspec
CHECKOUT OPTIONS:
LetsMove:
:commit: 7abf4daed1a25218f2b52f2dfd190aee5a50071c
:git: https://github.com/lwouis/LetsMove.git
ShortcutRecorder:
:commit: 594b360e07a8a368ffec2567f77e465477b9994f
:git: https://github.com/lwouis/ShortcutRecorder.git
SPEC CHECKSUMS:
AppCenter: 883369ab78427b0561c688158d689dfe1f993ea9
LetsMove: fefe56bc7bc7fb7d37049e28a14f297961229fc5
ShortcutRecorder: fdf620aca34101b0cba3b10fca815e0459254189
Sparkle: 1fa490bb4ab2a9b37cfb9ea4feec19dd33b81cd2
SwiftyBeaver: d39e7c376bf15e9fffca8263b8fd1f42ea56aa2d
PODFILE CHECKSUM: c20cb0e8753361ba1c1daea73624f879862271ed
COCOAPODS: 1.16.2
BIN
View File
Binary file not shown.
@@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>AppCenter.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>AppCenter.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>AppCenter.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_arm64e_armv7_armv7s</string>
<key>LibraryPath</key>
<string>AppCenter.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>arm64e</string>
<string>armv7</string>
<string>armv7s</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>AppCenter.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>AppCenter.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
@@ -1,13 +0,0 @@
framework module AppCenter {
umbrella header "AppCenter.h"
export *
module * { export * }
link framework "Foundation"
link framework "CoreTelephony"
link framework "SystemConfiguration"
link framework "UIKit"
link "sqlite3"
link "z"
}
@@ -1,44 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACAppCenter.h>)
#import <AppCenter/MSACAbstractLog.h>
#import <AppCenter/MSACAppCenter.h>
#import <AppCenter/MSACAppCenterErrors.h>
#import <AppCenter/MSACChannelGroupProtocol.h>
#import <AppCenter/MSACChannelProtocol.h>
#import <AppCenter/MSACConstants+Flags.h>
#import <AppCenter/MSACConstants.h>
#import <AppCenter/MSACCustomProperties.h>
#import <AppCenter/MSACDevice.h>
#import <AppCenter/MSACEnable.h>
#import <AppCenter/MSACLog.h>
#import <AppCenter/MSACLogWithProperties.h>
#import <AppCenter/MSACLogger.h>
#import <AppCenter/MSACSerializableObject.h>
#import <AppCenter/MSACService.h>
#import <AppCenter/MSACServiceAbstract.h>
#import <AppCenter/MSACWrapperLogger.h>
#import <AppCenter/MSACWrapperSdk.h>
#else
#import "MSACAbstractLog.h"
#import "MSACAppCenter.h"
#import "MSACAppCenterErrors.h"
#import "MSACChannelGroupProtocol.h"
#import "MSACChannelProtocol.h"
#import "MSACConstants+Flags.h"
#import "MSACConstants.h"
#import "MSACCustomProperties.h"
#import "MSACDevice.h"
#import "MSACEnable.h"
#import "MSACLog.h"
#import "MSACLogWithProperties.h"
#import "MSACLogger.h"
#import "MSACSerializableObject.h"
#import "MSACService.h"
#import "MSACServiceAbstract.h"
#import "MSACWrapperLogger.h"
#import "MSACWrapperSdk.h"
#endif
@@ -1,203 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_APP_CENTER
#define MSAC_APP_CENTER
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
@class MSACWrapperSdk;
#if !TARGET_OS_TV
@class MSACCustomProperties;
#endif
NS_SWIFT_NAME(AppCenter)
@interface MSACAppCenter : NSObject
/**
* Returns the singleton instance of MSACAppCenter.
*/
+ (instancetype)sharedInstance;
/**
* Configure the SDK with an application secret.
*
* @param appSecret A unique and secret key used to identify the application.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configureWithAppSecret:(NSString *)appSecret NS_SWIFT_NAME(configure(withAppSecret:));
/**
* Configure the SDK.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configure;
/**
* Configure the SDK with an application secret and an array of services to start.
*
* @param appSecret A unique and secret key used to identify the application.
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)start:(NSString *)appSecret withServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(withAppSecret:services:));
/**
* Start the SDK with an array of services.
*
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)startWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(services:));
/**
* Start a service.
*
* @param service A service to start.
*
* @discussion This may be called only once per service per application process lifetime.
*/
+ (void)startService:(Class)service;
/**
* Configure the SDK with an array of services to start from a library. This will not start the service at application level, it will enable
* the service only for the library.
*
* @param services Array of services to start.
*/
+ (void)startFromLibraryWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(startFromLibrary(services:));
/**
* The flag indicates whether the SDK has already been configured or not.
*/
@property(class, atomic, readonly, getter=isConfigured) BOOL configured;
/**
* The flag indicates whether app is running in App Center Test Cloud.
*/
@property(class, atomic, readonly, getter=isRunningInAppCenterTestCloud) BOOL runningInAppCenterTestCloud;
/**
* The flag indicates whether or not the SDK was enabled as a whole
*
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
/**
* Flag indicating whether SDK can send network requests.
*
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isNetworkRequestsAllowed, setter=setNetworkRequestsAllowed:)
BOOL networkRequestsAllowed NS_SWIFT_NAME(networkRequestsAllowed);
/**
* The SDK's log level.
*/
@property(class, nonatomic) MSACLogLevel logLevel;
/**
* Base URL to use for backend communication.
*/
@property(class, nonatomic, strong) NSString *logUrl;
/**
* Set log handler.
*/
@property(class, nonatomic) MSACLogHandler logHandler;
/**
* Set wrapper SDK information to use when building device properties. This is intended in case you are building a SDK that uses the App
* Center SDK under the hood, e.g. our Xamarin SDK or ReactNative SDk.
*/
@property(class, nonatomic, strong) MSACWrapperSdk *wrapperSdk;
#if !TARGET_OS_TV
/**
* Set the custom properties.
*
* @param customProperties Custom properties object.
*/
+ (void)setCustomProperties:(MSACCustomProperties *)customProperties;
#endif
/**
* Check whether the application delegate forwarder is enabled or not.
*
* @discussion The application delegate forwarder forwards messages that target your application delegate methods via swizzling to the SDK.
* It simplifies the SDK integration but may not be suitable to any situations. For
* instance it should be disabled if you or one of your third party SDK is doing message forwarding on the application delegate. Message
* forwarding usually implies the implementation of @see NSObject#forwardingTargetForSelector: or @see NSObject#forwardInvocation: methods.
* To disable the application delegate forwarder just add the `AppCenterAppDelegateForwarderEnabled` tag to your Info .plist file and set it
* to `0`. Then you will have to forward any application delegate needed by the SDK manually.
*/
@property(class, readonly, nonatomic, getter=isAppDelegateForwarderEnabled) BOOL appDelegateForwarderEnabled;
/**
* Unique installation identifier.
*
*/
@property(class, readonly, nonatomic) NSUUID *installId;
/**
* Detect if a debugger is attached to the app process. This is only invoked once on app startup and can not detect
* if the debugger is being attached during runtime!
*
*/
@property(class, readonly, nonatomic, getter=isDebuggerAttached) BOOL debuggerAttached;
/**
* Current version of AppCenter SDK.
*
*/
@property(class, readonly, nonatomic) NSString *sdkVersion;
/**
* Set the maximum size of the internal storage. This method must be called before App Center is started. This method is only intended for
* applications.
*
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
* (default is 4096 bytes). Values below 20,480 bytes (20 KiB) will be ignored.
*
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
* is successful, and `NO` otherwise. This parameter can be null.
*
* @discussion This only sets the maximum size of the database, but App Center modules might store additional data.
* The value passed to this method is not persisted on disk. The default maximum database size is 10485760 bytes (10 MiB).
*/
+ (void)setMaxStorageSize:(long)sizeInBytes completionHandler:(void (^)(BOOL))completionHandler;
/**
* Set the user identifier.
*
* @discussion Set the user identifier for logs sent for the default target token when the secret passed in @c
* MSACAppCenter:start:withServices: contains "target={targetToken}".
*
* For App Center backend the user identifier maximum length is 256 characters.
*
* AppCenter must be configured or started before this API can be used.
*/
@property(class, nonatomic, strong) NSString *userId;
/**
* Set country code to use when building device properties.
*
* @see https://www.iso.org/obp/ui/#search for more information.
*/
@property(class, nonatomic, strong) NSString *countryCode;
@end
#endif
@@ -1,41 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_APP_CENTER_ERRORS_H
#define MSAC_APP_CENTER_ERRORS_H
#import <Foundation/Foundation.h>
#define MSAC_APP_CENTER_BASE_DOMAIN @"com.Microsoft.AppCenter."
NS_ASSUME_NONNULL_BEGIN
#pragma mark - Domain
static NSString *const kMSACACErrorDomain = MSAC_APP_CENTER_BASE_DOMAIN @"ErrorDomain";
#pragma mark - General
// Error codes.
NS_ENUM(NSInteger){MSACACLogInvalidContainerErrorCode = 1, MSACACCanceledErrorCode = 2, MSACACDisabledErrorCode = 3};
// Error descriptions.
static NSString const *kMSACACLogInvalidContainerErrorDesc = @"Invalid log container.";
static NSString const *kMSACACCanceledErrorDesc = @"The operation was canceled.";
static NSString const *kMSACACDisabledErrorDesc = @"The service is disabled.";
#pragma mark - Connection
// Error codes.
NS_ENUM(NSInteger){MSACACConnectionPausedErrorCode = 100, MSACACConnectionHttpErrorCode = 101};
// Error descriptions.
static NSString const *kMSACACConnectionHttpErrorDesc = @"An HTTP error occured.";
static NSString const *kMSACACConnectionPausedErrorDesc = @"Canceled, connection paused with log deletion.";
// Error user info keys.
static NSString const *kMSACACConnectionHttpCodeErrorKey = @"MSConnectionHttpCode";
NS_ASSUME_NONNULL_END
#endif
@@ -1,87 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CHANNEL_GROUP_PROTOCOL_H
#define MSAC_CHANNEL_GROUP_PROTOCOL_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACChannelProtocol.h>)
#import <AppCenter/MSACChannelProtocol.h>
#else
#import "MSACChannelProtocol.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@class MSACChannelUnitConfiguration;
@protocol MSACIngestionProtocol;
@protocol MSACChannelUnitProtocol;
/**
* `MSACChannelGroupProtocol` represents a kind of channel that contains constituent MSACChannelUnit objects. When an operation from the
* `MSACChannelProtocol` is performed on the group, that operation should be propagated to its constituent MSACChannelUnit objects.
*/
NS_SWIFT_NAME(ChannelGroupProtocol)
@protocol MSACChannelGroupProtocol <MSACChannelProtocol>
/**
* Initialize a channel unit with the given configuration.
*
* @param configuration channel configuration.
*
* @return The added `MSACChannelUnitProtocol`. Use this object to enqueue logs.
*/
- (id<MSACChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSACChannelUnitConfiguration *)configuration
NS_SWIFT_NAME(addChannelUnit(withConfiguration:));
/**
* Initialize a channel unit with the given configuration.
*
* @param configuration channel configuration.
* @param ingestion The alternative ingestion object
*
* @return The added `MSACChannelUnitProtocol`. Use this object to enqueue logs.
*/
- (id<MSACChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSACChannelUnitConfiguration *)configuration
withIngestion:(nullable id<MSACIngestionProtocol>)ingestion
NS_SWIFT_NAME(addChannelUnit(_:ingestion:));
/**
* Change the base URL (schema + authority + port only) used to communicate with the backend.
*/
@property(nonatomic, strong) NSString *_Nullable logUrl;
/**
* Set the app secret.
*/
@property(nonatomic, strong) NSString *_Nullable appSecret;
/**
* Set the maximum size of the internal storage. This method must be called before App Center is started.
*
* @discussion The default maximum database size is 10485760 bytes (10 MiB).
*
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
* (default is 4096 bytes). Values below 24576 bytes (24 KiB) will be ignored.
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
* is successful, and `NO` otherwise.
*/
- (void)setMaxStorageSize:(long)sizeInBytes
completionHandler:(nullable void (^)(BOOL))completionHandler NS_SWIFT_NAME(setMaxStorageSize(_:completionHandler:));
/**
* Return a channel unit instance for the given groupId.
*
* @param groupId The group ID for a channel unit.
*
* @return A channel unit instance or `nil`.
*/
- (nullable id<MSACChannelUnitProtocol>)channelUnitForGroupId:(NSString *)groupId;
@end
NS_ASSUME_NONNULL_END
#endif
@@ -1,68 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CHANNEL_PROTOCOL_H
#define MSAC_CHANNEL_PROTOCOL_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACEnable.h>)
#import <AppCenter/MSACEnable.h>
#else
#import "MSACEnable.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@protocol MSACChannelDelegate;
/**
* `MSACChannelProtocol` contains the essential operations of a channel. Channels are broadly responsible for enqueuing logs to be sent to
* the backend and/or stored on disk.
*/
NS_SWIFT_NAME(ChannelProtocol)
@protocol MSACChannelProtocol <NSObject, MSACEnable>
/**
* Add delegate.
*
* @param delegate delegate.
*/
- (void)addDelegate:(id<MSACChannelDelegate>)delegate;
/**
* Remove delegate.
*
* @param delegate delegate.
*/
- (void)removeDelegate:(id<MSACChannelDelegate>)delegate;
/**
* Pause operations, logs will be stored but not sent.
*
* @param identifyingObject Object used to identify the pause request.
*
* @discussion A paused channel doesn't forward logs to the ingestion. The identifying object used to pause the channel can be any unique
* object. The same identifying object must be used to call resume. For simplicity if the caller is the one owning the channel then @c self
* can be used as identifying object.
*
* @see resumeWithIdentifyingObject:
*/
- (void)pauseWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* Resume operations, logs can be sent again.
*
* @param identifyingObject Object used to passed to the pause method.
*
* @discussion The channel only resume when all the outstanding identifying objects have been resumed.
*
* @see pauseWithIdentifyingObject:
*/
- (void)resumeWithIdentifyingObject:(id<NSObject>)identifyingObject;
@end
NS_ASSUME_NONNULL_END
#endif
@@ -1,18 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CONSTANTS_FLAGS_H
#define MSAC_CONSTANTS_FLAGS_H
#import <Foundation/Foundation.h>
typedef NS_OPTIONS(NSUInteger, MSACFlags) {
MSACFlagsNone = (0 << 0), // => 00000000
MSACFlagsNormal = (1 << 0), // => 00000001
MSACFlagsCritical = (1 << 1), // => 00000010
MSACFlagsPersistenceNormal DEPRECATED_MSG_ATTRIBUTE("please use MSACFlagsNormal") = MSACFlagsNormal,
MSACFlagsPersistenceCritical DEPRECATED_MSG_ATTRIBUTE("please use MSACFlagsCritical") = MSACFlagsCritical,
MSACFlagsDefault = MSACFlagsNormal
} NS_SWIFT_NAME(Flags);
#endif
@@ -1,170 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
/**
* Log Levels
*/
typedef NS_ENUM(NSUInteger, MSACLogLevel) {
/**
* Logging will be very chatty
*/
MSACLogLevelVerbose = 2,
/**
* Debug information will be logged
*/
MSACLogLevelDebug = 3,
/**
* Information will be logged
*/
MSACLogLevelInfo = 4,
/**
* Errors and warnings will be logged
*/
MSACLogLevelWarning = 5,
/**
* Errors will be logged
*/
MSACLogLevelError = 6,
/**
* Only critical errors will be logged
*/
MSACLogLevelAssert = 7,
/**
* Logging is disabled
*/
MSACLogLevelNone = 99
} NS_SWIFT_NAME(LogLevel);
typedef NSString * (^MSACLogMessageProvider)(void)NS_SWIFT_NAME(LogMessageProvider);
typedef void (^MSACLogHandler)(MSACLogMessageProvider messageProvider, MSACLogLevel logLevel, NSString *tag, const char *file,
const char *function, uint line) NS_SWIFT_NAME(LogHandler);
/**
* Channel priorities, check the kMSACPriorityCount if you add a new value.
* The order matters here! Values NEED to range from low priority to high priority.
*/
typedef NS_ENUM(NSInteger, MSACPriority) { MSACPriorityBackground, MSACPriorityDefault, MSACPriorityHigh } NS_SWIFT_NAME(Priority);
static short const kMSACPriorityCount = MSACPriorityHigh + 1;
/**
* The priority by which the modules are initialized.
* MSACPriorityMax is reserved for only 1 module and this needs to be Crashes.
* Crashes needs to be initialized first to catch crashes in our other SDK Modules (which will hopefully never happen) and to avoid losing
* any log at crash time.
*/
typedef NS_ENUM(NSInteger, MSACInitializationPriority) {
MSACInitializationPriorityDefault = 500,
MSACInitializationPriorityHigh = 750,
MSACInitializationPriorityMax = 999
} NS_SWIFT_NAME(InitializationPriority);
/**
* Enum with the different HTTP status codes.
*/
typedef NS_ENUM(NSInteger, MSACHTTPCodesNo) {
// Invalid
MSACHTTPCodesNo0XXInvalidUnknown = 0,
// Informational
MSACHTTPCodesNo1XXInformationalUnknown = 1,
MSACHTTPCodesNo100Continue = 100,
MSACHTTPCodesNo101SwitchingProtocols = 101,
MSACHTTPCodesNo102Processing = 102,
// Success
MSACHTTPCodesNo2XXSuccessUnknown = 2,
MSACHTTPCodesNo200OK = 200,
MSACHTTPCodesNo201Created = 201,
MSACHTTPCodesNo202Accepted = 202,
MSACHTTPCodesNo203NonAuthoritativeInformation = 203,
MSACHTTPCodesNo204NoContent = 204,
MSACHTTPCodesNo205ResetContent = 205,
MSACHTTPCodesNo206PartialContent = 206,
MSACHTTPCodesNo207MultiStatus = 207,
MSACHTTPCodesNo208AlreadyReported = 208,
MSACHTTPCodesNo209IMUsed = 209,
// Redirection
MSACHTTPCodesNo3XXSuccessUnknown = 3,
MSACHTTPCodesNo300MultipleChoices = 300,
MSACHTTPCodesNo301MovedPermanently = 301,
MSACHTTPCodesNo302Found = 302,
MSACHTTPCodesNo303SeeOther = 303,
MSACHTTPCodesNo304NotModified = 304,
MSACHTTPCodesNo305UseProxy = 305,
MSACHTTPCodesNo306SwitchProxy = 306,
MSACHTTPCodesNo307TemporaryRedirect = 307,
MSACHTTPCodesNo308PermanentRedirect = 308,
// Client error
MSACHTTPCodesNo4XXSuccessUnknown = 4,
MSACHTTPCodesNo400BadRequest = 400,
MSACHTTPCodesNo401Unauthorised = 401,
MSACHTTPCodesNo402PaymentRequired = 402,
MSACHTTPCodesNo403Forbidden = 403,
MSACHTTPCodesNo404NotFound = 404,
MSACHTTPCodesNo405MethodNotAllowed = 405,
MSACHTTPCodesNo406NotAcceptable = 406,
MSACHTTPCodesNo407ProxyAuthenticationRequired = 407,
MSACHTTPCodesNo408RequestTimeout = 408,
MSACHTTPCodesNo409Conflict = 409,
MSACHTTPCodesNo410Gone = 410,
MSACHTTPCodesNo411LengthRequired = 411,
MSACHTTPCodesNo412PreconditionFailed = 412,
MSACHTTPCodesNo413RequestEntityTooLarge = 413,
MSACHTTPCodesNo414RequestURITooLong = 414,
MSACHTTPCodesNo415UnsupportedMediaType = 415,
MSACHTTPCodesNo416RequestedRangeNotSatisfiable = 416,
MSACHTTPCodesNo417ExpectationFailed = 417,
MSACHTTPCodesNo418IamATeapot = 418,
MSACHTTPCodesNo419AuthenticationTimeout = 419,
MSACHTTPCodesNo420MethodFailureSpringFramework = 420,
MSACHTTPCodesNo420EnhanceYourCalmTwitter = 4200,
MSACHTTPCodesNo422UnprocessableEntity = 422,
MSACHTTPCodesNo423Locked = 423,
MSACHTTPCodesNo424FailedDependency = 424,
MSACHTTPCodesNo424MethodFailureWebDaw = 4240,
MSACHTTPCodesNo425UnorderedCollection = 425,
MSACHTTPCodesNo426UpgradeRequired = 426,
MSACHTTPCodesNo428PreconditionRequired = 428,
MSACHTTPCodesNo429TooManyRequests = 429,
MSACHTTPCodesNo431RequestHeaderFieldsTooLarge = 431,
MSACHTTPCodesNo444NoResponseNginx = 444,
MSACHTTPCodesNo449RetryWithMicrosoft = 449,
MSACHTTPCodesNo450BlockedByWindowsParentalControls = 450,
MSACHTTPCodesNo451RedirectMicrosoft = 451,
MSACHTTPCodesNo451UnavailableForLegalReasons = 4510,
MSACHTTPCodesNo494RequestHeaderTooLargeNginx = 494,
MSACHTTPCodesNo495CertErrorNginx = 495,
MSACHTTPCodesNo496NoCertNginx = 496,
MSACHTTPCodesNo497HTTPToHTTPSNginx = 497,
MSACHTTPCodesNo499ClientClosedRequestNginx = 499,
// Server error
MSACHTTPCodesNo5XXSuccessUnknown = 5,
MSACHTTPCodesNo500InternalServerError = 500,
MSACHTTPCodesNo501NotImplemented = 501,
MSACHTTPCodesNo502BadGateway = 502,
MSACHTTPCodesNo503ServiceUnavailable = 503,
MSACHTTPCodesNo504GatewayTimeout = 504,
MSACHTTPCodesNo505HTTPVersionNotSupported = 505,
MSACHTTPCodesNo506VariantAlsoNegotiates = 506,
MSACHTTPCodesNo507InsufficientStorage = 507,
MSACHTTPCodesNo508LoopDetected = 508,
MSACHTTPCodesNo509BandwidthLimitExceeded = 509,
MSACHTTPCodesNo510NotExtended = 510,
MSACHTTPCodesNo511NetworkAuthenticationRequired = 511,
MSACHTTPCodesNo522ConnectionTimedOut = 522,
MSACHTTPCodesNo598NetworkReadTimeoutErrorUnknown = 598,
MSACHTTPCodesNo599NetworkConnectTimeoutErrorUnknown = 599
} NS_SWIFT_NAME(HTTPCodesNo);
@@ -1,71 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CUSTOM_PROPERTIES_H
#define MSAC_CUSTOM_PROPERTIES_H
#import <Foundation/Foundation.h>
/**
* Custom properties builder.
* Collects multiple properties to send in one log.
*/
NS_SWIFT_NAME(CustomProperties)
@interface MSACCustomProperties : NSObject
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setString:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setNumber:(NSNumber *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setBool:(BOOL)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setDate:(NSDate *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Clear the property for the specified key.
*
* @param key Key whose mapping is to be cleared.
*
* @return This instance.
*/
- (instancetype)clearPropertyForKey:(NSString *)key NS_SWIFT_NAME(clearProperty(forKey:));
@end
#endif
@@ -1,101 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_DEVICE_H
#define MSAC_DEVICE_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACWrapperSdk.h>)
#import <AppCenter/MSACWrapperSdk.h>
#else
#import "MSACWrapperSdk.h"
#endif
NS_SWIFT_NAME(Device)
@interface MSACDevice : MSACWrapperSdk
/*
* Name of the SDK. Consists of the name of the SDK and the platform, e.g. "appcenter.ios", "appcenter.android"
*/
@property(nonatomic, copy, readonly) NSString *sdkName;
/*
* Version of the SDK in semver format, e.g. "1.2.0" or "0.12.3-alpha.1".
*/
@property(nonatomic, copy, readonly) NSString *sdkVersion;
/*
* Device model (example: iPad2,3).
*/
@property(nonatomic, copy, readonly) NSString *model;
/*
* Device manufacturer (example: HTC).
*/
@property(nonatomic, copy, readonly) NSString *oemName;
/*
* OS name (example: iOS).
*/
@property(nonatomic, copy, readonly) NSString *osName;
/*
* OS version (example: 9.3.0).
*/
@property(nonatomic, copy, readonly) NSString *osVersion;
/*
* OS build code (example: LMY47X). [optional]
*/
@property(nonatomic, copy, readonly) NSString *osBuild;
/*
* API level when applicable like in Android (example: 15). [optional]
*/
@property(nonatomic, copy, readonly) NSNumber *osApiLevel;
/*
* Language code (example: en_US).
*/
@property(nonatomic, copy, readonly) NSString *locale;
/*
* The offset in minutes from UTC for the device time zone, including daylight savings time.
*/
@property(nonatomic, readonly, strong) NSNumber *timeZoneOffset;
/*
* Screen size of the device in pixels (example: 640x480).
*/
@property(nonatomic, copy, readonly) NSString *screenSize;
/*
* Application version name, e.g. 1.1.0
*/
@property(nonatomic, copy, readonly) NSString *appVersion;
/*
* Carrier name (for mobile devices). [optional]
*/
@property(nonatomic, copy, readonly) NSString *carrierName;
/*
* Carrier country code (for mobile devices). [optional]
*/
@property(nonatomic, copy, readonly) NSString *carrierCountry;
/*
* The app's build number, e.g. 42.
*/
@property(nonatomic, copy, readonly) NSString *appBuild;
/*
* The bundle identifier, package identifier, or namespace, depending on what the individual plattforms use, .e.g com.microsoft.example.
* [optional]
*/
@property(nonatomic, copy, readonly) NSString *appNamespace;
@end
#endif
@@ -1,27 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_ENABLE_H
#define MSAC_ENABLE_H
#import <Foundation/Foundation.h>
/**
* Protocol to define an instance that can be enabled/disabled.
*/
NS_SWIFT_NAME(Enable)
@protocol MSACEnable <NSObject>
@required
/**
* Enable/disable this instance and delete data on disabled state.
*
* @param isEnabled A boolean value set to YES to enable the instance or NO to disable it.
* @param deleteData A boolean value set to YES to delete data or NO to keep it.
*/
- (void)setEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deleteData NS_SWIFT_NAME(setEnabled(_:deleteDataOnDisabled:));
@end
#endif
@@ -1,74 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_LOG_H
#define MSAC_LOG_H
#import <Foundation/Foundation.h>
@class MSACDevice;
NS_SWIFT_NAME(Log)
@protocol MSACLog <NSObject>
/**
* Log type.
*/
@property(nonatomic, copy) NSString *type;
/**
* Log timestamp.
*/
@property(nonatomic, strong) NSDate *timestamp;
/**
* A session identifier is used to correlate logs together. A session is an abstract concept in the API and is not necessarily an analytics
* session, it can be used to only track crashes.
*/
@property(nonatomic, copy) NSString *sid;
/**
* Optional distribution group ID value.
*/
@property(nonatomic, copy) NSString *distributionGroupId;
/**
* Optional user identifier.
*/
@property(nonatomic, copy) NSString *userId;
/**
* Device properties associated to this log.
*/
@property(nonatomic, strong) MSACDevice *device;
/**
* Transient object tag. For example, a log can be tagged with a transmission target. We do this currently to prevent properties being
* applied retroactively to previous logs by comparing their tags.
*/
@property(nonatomic, strong) NSObject *tag;
/**
* Checks if the object's values are valid.
*
* @return YES, if the object is valid.
*/
- (BOOL)isValid;
/**
* Adds a transmission target token that this log should be sent to.
*
* @param token The transmission target token.
*/
- (void)addTransmissionTargetToken:(NSString *)token;
/**
* Gets all transmission target tokens that this log should be sent to.
*
* @returns Collection of transmission target tokens that this log should be sent to.
*/
- (NSSet *)transmissionTargetTokens;
@end
#endif
@@ -1,25 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_LOG_WITH_PROPERTIES_H
#define MSAC_LOG_WITH_PROPERTIES_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACAbstractLog.h>)
#import <AppCenter/MSACAbstractLog.h>
#else
#import "MSACAbstractLog.h"
#endif
NS_SWIFT_NAME(LogWithProperties)
@interface MSACLogWithProperties : MSACAbstractLog
/**
* Additional key/value pair parameters. [optional]
*/
@property(nonatomic, strong) NSDictionary<NSString *, NSString *> *properties;
@end
#endif
@@ -1,54 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_LOGGER
#define MSAC_LOGGER
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
#define MSACLog(_level, _tag, _message) \
[MSACLogger logMessage:_message level:_level tag:_tag file:__FILE__ function:__PRETTY_FUNCTION__ line:__LINE__]
#define MSACLogAssert(tag, format, ...) \
MSACLog(MSACLogLevelAssert, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogError(tag, format, ...) \
MSACLog(MSACLogLevelError, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogWarning(tag, format, ...) \
MSACLog(MSACLogLevelWarning, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogInfo(tag, format, ...) \
MSACLog(MSACLogLevelInfo, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogDebug(tag, format, ...) \
MSACLog(MSACLogLevelDebug, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogVerbose(tag, format, ...) \
MSACLog(MSACLogLevelVerbose, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
NS_SWIFT_NAME(Logger)
@interface MSACLogger : NSObject
+ (void)logMessage:(MSACLogMessageProvider)messageProvider
level:(MSACLogLevel)loglevel
tag:(NSString *)tag
file:(const char *)file
function:(const char *)function
line:(uint)line;
@end
#endif
@@ -1,19 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef SERIALIZABLE_OBJECT_H
#define SERIALIZABLE_OBJECT_H
@protocol MSACSerializableObject <NSCoding>
/**
* Serialize this object to a dictionary.
*
* @return A dictionary representing this object.
*/
- (NSMutableDictionary *)serializeToDictionary;
@end
#endif
@@ -1,23 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_SERVICE_H
#define MSAC_SERVICE_H
#import <Foundation/Foundation.h>
/**
* Protocol declaring service logic.
*/
NS_SWIFT_NAME(Service)
@protocol MSACService <NSObject>
/**
* Indicates whether this service is enabled.
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
@end
#endif
@@ -1,58 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_SERVICE_ABSTRACT_H
#define MSAC_SERVICE_ABSTRACT_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACService.h>)
#import <AppCenter/MSACService.h>
#else
#import "MSACService.h"
#endif
@protocol MSACChannelGroupProtocol;
/**
* Abstraction of services common logic.
* This class is intended to be subclassed only not instantiated directly.
*/
NS_SWIFT_NAME(ServiceAbstract)
@interface MSACServiceAbstract : NSObject <MSACService>
/**
* The flag indicates whether the service is started from application or not.
*/
@property(nonatomic, assign) BOOL startedFromApplication;
/**
* Start this service with a channel group. Also sets the flag that indicates that a service has been started.
*
* @param channelGroup channel group used to persist and send logs.
* @param appSecret app secret for the SDK.
* @param token default transmission target token for this service.
* @param fromApplication indicates whether the service started from an application or not.
*/
- (void)startWithChannelGroup:(id<MSACChannelGroupProtocol>)channelGroup
appSecret:(NSString *)appSecret
transmissionTargetToken:(NSString *)token
fromApplication:(BOOL)fromApplication;
/**
* Update configuration when the service requires to start again. This method should only be called if the service is started from libraries
* and then is being started from an application.
*
* @param appSecret app secret for the SDK.
* @param token default transmission target token for this service.
*/
- (void)updateConfigurationWithAppSecret:(NSString *)appSecret transmissionTargetToken:(NSString *)token;
/**
* The flag indicate whether the service needs the application secret or not.
*/
@property(atomic, readonly) BOOL isAppSecretRequired;
@end
#endif
@@ -1,21 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
/**
* This is a utility for producing App Center style log messages. It is only intended for use by App Center services and wrapper SDKs of App
* Center.
*/
NS_SWIFT_NAME(WrapperLogger)
@interface MSACWrapperLogger : NSObject
+ (void)MSACWrapperLog:(MSACLogMessageProvider)message tag:(NSString *)tag level:(MSACLogLevel)level;
@end
@@ -1,60 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_WRAPPER_SDK_H
#define MSAC_WRAPPER_SDK_H
#import <Foundation/Foundation.h>
NS_SWIFT_NAME(WrapperSdk)
@interface MSACWrapperSdk : NSObject
/*
* Version of the wrapper SDK. When the SDK is embedding another base SDK (for example Xamarin.Android wraps Android), the Xamarin specific
* version is populated into this field while sdkVersion refers to the original Android SDK. [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperSdkVersion;
/*
* Name of the wrapper SDK (examples: Xamarin, Cordova). [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperSdkName;
/*
* Version of the wrapper technology framework (Xamarin runtime version or ReactNative or Cordova etc...). [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperRuntimeVersion;
/*
* Label that is used to identify application code 'version' released via Live Update beacon running on device.
*/
@property(nonatomic, copy, readonly) NSString *liveUpdateReleaseLabel;
/*
* Identifier of environment that current application release belongs to, deployment key then maps to environment like Production, Staging.
*/
@property(nonatomic, copy, readonly) NSString *liveUpdateDeploymentKey;
/*
* Hash of all files (ReactNative or Cordova) deployed to device via LiveUpdate beacon. Helps identify the Release version on device or need
* to download updates in future
*/
@property(nonatomic, copy, readonly) NSString *liveUpdatePackageHash;
- (instancetype)initWithWrapperSdkVersion:(NSString *)wrapperSdkVersion
wrapperSdkName:(NSString *)wrapperSdkName
wrapperRuntimeVersion:(NSString *)wrapperRuntimeVersion
liveUpdateReleaseLabel:(NSString *)liveUpdateReleaseLabel
liveUpdateDeploymentKey:(NSString *)liveUpdateDeploymentKey
liveUpdatePackageHash:(NSString *)liveUpdatePackageHash;
/**
* Checks if the object's values are valid.
*
* @return YES, if the object is valid.
*/
- (BOOL)isValid;
@end
#endif
@@ -1,13 +0,0 @@
framework module AppCenter {
umbrella header "AppCenter.h"
export *
module * { export * }
link framework "Foundation"
link framework "CoreTelephony"
link framework "SystemConfiguration"
link framework "UIKit"
link "sqlite3"
link "z"
}
@@ -1,114 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#import "MSACConstants+Flags.h"
@protocol MSACChannelUnitProtocol;
@protocol MSACChannelGroupProtocol;
@protocol MSACChannelProtocol;
@protocol MSACLog;
NS_ASSUME_NONNULL_BEGIN
@protocol MSACChannelDelegate <NSObject>
@optional
/**
* A callback that is called when a channel unit is added to the channel group.
*
* @param channelGroup The channel group.
* @param channel The newly added channel.
*/
- (void)channelGroup:(id<MSACChannelGroupProtocol>)channelGroup didAddChannelUnit:(id<MSACChannelUnitProtocol>)channel;
/**
* A callback that is called when a log is just enqueued. Delegates may want to prepare the log a little more before further processing.
*
* @param log The log to prepare.
*/
- (void)channel:(id<MSACChannelProtocol>)channel prepareLog:(id<MSACLog>)log;
/**
* A callback that is called after a log is definitely prepared.
*
* @param log The log.
* @param internalId An internal Id to keep track of logs.
* @param flags Options for the log.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didPrepareLog:(id<MSACLog>)log internalId:(NSString *)internalId flags:(MSACFlags)flags;
/**
* A callback that is called after a log completed the enqueueing process whether it was successful or not.
*
* @param log The log.
* @param internalId An internal Id to keep track of logs.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didCompleteEnqueueingLog:(id<MSACLog>)log internalId:(NSString *)internalId;
/**
* Callback method that will be called before each log will be send to the server.
*
* @param channel The channel object.
* @param log The log to be sent.
*/
- (void)channel:(id<MSACChannelProtocol>)channel willSendLog:(id<MSACLog>)log;
/**
* Callback method that will be called in case the SDK was able to send a log.
*
* @param channel The channel object.
* @param log The log to be sent.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didSucceedSendingLog:(id<MSACLog>)log;
/**
* Callback method that will be called in case the SDK was unable to send a log.
*
* @param channel The channel object.
* @param log The log to be sent.
* @param error The error that occured.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didFailSendingLog:(id<MSACLog>)log withError:(nullable NSError *)error;
/**
* A callback that is called when setEnabled has been invoked.
*
* @param channel The channel.
* @param isEnabled The boolean that indicates enabled.
* @param deletedData The boolean that indicates deleting data on disabled.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didSetEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deletedData;
/**
* A callback that is called when pause has been invoked.
*
* @param channel The channel.
* @param identifyingObject The identifying object used to pause the channel.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didPauseWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* A callback that is called when resume has been invoked.
*
* @param channel The channel.
* @param identifyingObject The identifying object used to resume the channel.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didResumeWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* Callback method that will determine if a log should be filtered out from the usual processing pipeline. If any delegate returns true, the
* log is filtered.
*
* @param channelUnit The channel unit that is going to send the log.
* @param log The log to be filtered or not.
*
* @return `true` if the log should be filtered out.
*/
- (BOOL)channelUnit:(id<MSACChannelUnitProtocol>)channelUnit shouldFilterLog:(id<MSACLog>)log;
@end
NS_ASSUME_NONNULL_END
@@ -1,417 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Headers/AppCenter.h</key>
<data>
w9sW6K7DVhGfORLCjGXijaR25m0=
</data>
<key>Headers/MSACAbstractLog.h</key>
<data>
+Ikfy/fTOpqwPZM3Fpii3cpsx8Y=
</data>
<key>Headers/MSACAppCenter.h</key>
<data>
2cUgfgx3odOGivdk+n6FXq94KgU=
</data>
<key>Headers/MSACAppCenterErrors.h</key>
<data>
x7h4qpHD4GI3jrJ3F7n4UXAANsk=
</data>
<key>Headers/MSACChannelGroupProtocol.h</key>
<data>
jyWCHN4PSygLVy0IM5565DvDQAc=
</data>
<key>Headers/MSACChannelProtocol.h</key>
<data>
Y1rKi/TsirTR0MGBf1rIO/TTG0A=
</data>
<key>Headers/MSACConstants+Flags.h</key>
<data>
GK1gUSyIjWdv7KBP68wNxjxaH+E=
</data>
<key>Headers/MSACConstants.h</key>
<data>
d9HwKA0/VH3+pLRj1Pd49mqn2gI=
</data>
<key>Headers/MSACCustomProperties.h</key>
<data>
m7A9hEgL3d0gV4SyKmXJYRtwqoQ=
</data>
<key>Headers/MSACDevice.h</key>
<data>
suv4Wkt36Nkscy7jX2SSYzrkLRs=
</data>
<key>Headers/MSACEnable.h</key>
<data>
3DnplEFkD1LImYNk+84TqcQvBho=
</data>
<key>Headers/MSACLog.h</key>
<data>
1/7NIwYuYLGHIVMZps8b6/zOpJg=
</data>
<key>Headers/MSACLogWithProperties.h</key>
<data>
I4y13KVE36pyXv85mc5OWlCjplE=
</data>
<key>Headers/MSACLogger.h</key>
<data>
CaYHmB3+psy5/txfMvd2+bWGJkc=
</data>
<key>Headers/MSACSerializableObject.h</key>
<data>
or5nqKvOQVn2ZieUCmYK6fIZkWY=
</data>
<key>Headers/MSACService.h</key>
<data>
lz5atiMe+oTdu9e6g74KPC0CjOs=
</data>
<key>Headers/MSACServiceAbstract.h</key>
<data>
rBHatSAJK78PLgsMIpFqkby4tgA=
</data>
<key>Headers/MSACWrapperLogger.h</key>
<data>
qBVuNkF12BZYytRhCKwZ7zkiKhc=
</data>
<key>Headers/MSACWrapperSdk.h</key>
<data>
W9sdhEGnIGk/aFHS3gWwQ6FxUfI=
</data>
<key>Info.plist</key>
<data>
vQsDzcm1lLcpUNIaE5cw31rdoVk=
</data>
<key>Modules/module.modulemap</key>
<data>
go9b9XYQJIVcGlS/K5PS+8A+0dI=
</data>
<key>PrivateHeaders/MSACChannelDelegate.h</key>
<data>
Msff4BZ/b1IjaYeKTDBHtNtT7wI=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/AppCenter.h</key>
<dict>
<key>hash</key>
<data>
w9sW6K7DVhGfORLCjGXijaR25m0=
</data>
<key>hash2</key>
<data>
e9qe35Ew1pz0RMBfwa2Jv+3188p8iTwwktkIgCa/ztg=
</data>
</dict>
<key>Headers/MSACAbstractLog.h</key>
<dict>
<key>hash</key>
<data>
+Ikfy/fTOpqwPZM3Fpii3cpsx8Y=
</data>
<key>hash2</key>
<data>
7hsXFv3UkGsJLcc3eh2pMUrGbGYP2hCUC854z05SzNQ=
</data>
</dict>
<key>Headers/MSACAppCenter.h</key>
<dict>
<key>hash</key>
<data>
2cUgfgx3odOGivdk+n6FXq94KgU=
</data>
<key>hash2</key>
<data>
C10z0NrhN4J4qdWbypOdjlQ8QLlq4tvPMP21geOS4vI=
</data>
</dict>
<key>Headers/MSACAppCenterErrors.h</key>
<dict>
<key>hash</key>
<data>
x7h4qpHD4GI3jrJ3F7n4UXAANsk=
</data>
<key>hash2</key>
<data>
OcNwIIu4yFxG62mZtiABP3/9DoN9tj1fL/7nSvF8u8s=
</data>
</dict>
<key>Headers/MSACChannelGroupProtocol.h</key>
<dict>
<key>hash</key>
<data>
jyWCHN4PSygLVy0IM5565DvDQAc=
</data>
<key>hash2</key>
<data>
d36rCjxsURqDkFv+g5BwWNybz5Zksc9B91gqArFcJbk=
</data>
</dict>
<key>Headers/MSACChannelProtocol.h</key>
<dict>
<key>hash</key>
<data>
Y1rKi/TsirTR0MGBf1rIO/TTG0A=
</data>
<key>hash2</key>
<data>
fI1fLkJvo9SXh2bAUWKIYlretRCOoGWJwlyvqMfQZNc=
</data>
</dict>
<key>Headers/MSACConstants+Flags.h</key>
<dict>
<key>hash</key>
<data>
GK1gUSyIjWdv7KBP68wNxjxaH+E=
</data>
<key>hash2</key>
<data>
UDnw7GyNXzip13MvAvNKQQsWIUgU296uJHjPEkReCY8=
</data>
</dict>
<key>Headers/MSACConstants.h</key>
<dict>
<key>hash</key>
<data>
d9HwKA0/VH3+pLRj1Pd49mqn2gI=
</data>
<key>hash2</key>
<data>
xx69UfYa0qw6aSDuVsUAqd/1+t90QCPkQUae+elZwZ0=
</data>
</dict>
<key>Headers/MSACCustomProperties.h</key>
<dict>
<key>hash</key>
<data>
m7A9hEgL3d0gV4SyKmXJYRtwqoQ=
</data>
<key>hash2</key>
<data>
FveTXq+kqUdHHlSdLAoQisgT+95bzAuXTrTOQG/b/P8=
</data>
</dict>
<key>Headers/MSACDevice.h</key>
<dict>
<key>hash</key>
<data>
suv4Wkt36Nkscy7jX2SSYzrkLRs=
</data>
<key>hash2</key>
<data>
i3TVX2C+DfcRKn2HTBaydWBYHjryX2Cy/eJJxjTFiT8=
</data>
</dict>
<key>Headers/MSACEnable.h</key>
<dict>
<key>hash</key>
<data>
3DnplEFkD1LImYNk+84TqcQvBho=
</data>
<key>hash2</key>
<data>
XrDKc7bXZaW8JW4NMItSBrHLR6a+LRG1JSLXZ0U0NsI=
</data>
</dict>
<key>Headers/MSACLog.h</key>
<dict>
<key>hash</key>
<data>
1/7NIwYuYLGHIVMZps8b6/zOpJg=
</data>
<key>hash2</key>
<data>
3GF6xCTfpLDmOqKnacEOEDr5mkM/llKm0IoIEyISZKA=
</data>
</dict>
<key>Headers/MSACLogWithProperties.h</key>
<dict>
<key>hash</key>
<data>
I4y13KVE36pyXv85mc5OWlCjplE=
</data>
<key>hash2</key>
<data>
WIrz7Xsi04AboAmZ5dA3d3t8D/8PomKLwsp7oorznVM=
</data>
</dict>
<key>Headers/MSACLogger.h</key>
<dict>
<key>hash</key>
<data>
CaYHmB3+psy5/txfMvd2+bWGJkc=
</data>
<key>hash2</key>
<data>
GipSaz+D+Z5eWauQP+10U8xvbAnxPeIRD4HTvn0F5DQ=
</data>
</dict>
<key>Headers/MSACSerializableObject.h</key>
<dict>
<key>hash</key>
<data>
or5nqKvOQVn2ZieUCmYK6fIZkWY=
</data>
<key>hash2</key>
<data>
TdCeoNla8kUqc5HPES6WNwi7ycy+4vRr3HGDipEXNVE=
</data>
</dict>
<key>Headers/MSACService.h</key>
<dict>
<key>hash</key>
<data>
lz5atiMe+oTdu9e6g74KPC0CjOs=
</data>
<key>hash2</key>
<data>
aiO/PWAQDwhbPW1HDGqNM0kn4xYSwqPmdpmcTgpW/CE=
</data>
</dict>
<key>Headers/MSACServiceAbstract.h</key>
<dict>
<key>hash</key>
<data>
rBHatSAJK78PLgsMIpFqkby4tgA=
</data>
<key>hash2</key>
<data>
vi9/mVDQylipTtHNfUe9r4GXjlc2bEnKFV8wmN/IXaE=
</data>
</dict>
<key>Headers/MSACWrapperLogger.h</key>
<dict>
<key>hash</key>
<data>
qBVuNkF12BZYytRhCKwZ7zkiKhc=
</data>
<key>hash2</key>
<data>
h2VHxvALAogCMocFQMUjmOkhCm+qkJwpGTzxwdxTdwo=
</data>
</dict>
<key>Headers/MSACWrapperSdk.h</key>
<dict>
<key>hash</key>
<data>
W9sdhEGnIGk/aFHS3gWwQ6FxUfI=
</data>
<key>hash2</key>
<data>
5x+0epJnQN2wZKY2xjvsjAYrr6H1QGYIGz0ptux72dU=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash</key>
<data>
go9b9XYQJIVcGlS/K5PS+8A+0dI=
</data>
<key>hash2</key>
<data>
o0lkqm4+xeVosltUC3U+jCZnS35Tg8gUiUaKXbo0ZbQ=
</data>
</dict>
<key>PrivateHeaders/MSACChannelDelegate.h</key>
<dict>
<key>hash</key>
<data>
Msff4BZ/b1IjaYeKTDBHtNtT7wI=
</data>
<key>hash2</key>
<data>
d1uS+ptvOX/o3CCB23FEJAtvcf7KIf/8ozlruAf1f0g=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
@@ -1 +0,0 @@
Versions/Current/AppCenter
@@ -1 +0,0 @@
Versions/Current/PrivateHeaders
@@ -1,44 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACAppCenter.h>)
#import <AppCenter/MSACAbstractLog.h>
#import <AppCenter/MSACAppCenter.h>
#import <AppCenter/MSACAppCenterErrors.h>
#import <AppCenter/MSACChannelGroupProtocol.h>
#import <AppCenter/MSACChannelProtocol.h>
#import <AppCenter/MSACConstants+Flags.h>
#import <AppCenter/MSACConstants.h>
#import <AppCenter/MSACCustomProperties.h>
#import <AppCenter/MSACDevice.h>
#import <AppCenter/MSACEnable.h>
#import <AppCenter/MSACLog.h>
#import <AppCenter/MSACLogWithProperties.h>
#import <AppCenter/MSACLogger.h>
#import <AppCenter/MSACSerializableObject.h>
#import <AppCenter/MSACService.h>
#import <AppCenter/MSACServiceAbstract.h>
#import <AppCenter/MSACWrapperLogger.h>
#import <AppCenter/MSACWrapperSdk.h>
#else
#import "MSACAbstractLog.h"
#import "MSACAppCenter.h"
#import "MSACAppCenterErrors.h"
#import "MSACChannelGroupProtocol.h"
#import "MSACChannelProtocol.h"
#import "MSACConstants+Flags.h"
#import "MSACConstants.h"
#import "MSACCustomProperties.h"
#import "MSACDevice.h"
#import "MSACEnable.h"
#import "MSACLog.h"
#import "MSACLogWithProperties.h"
#import "MSACLogger.h"
#import "MSACSerializableObject.h"
#import "MSACService.h"
#import "MSACServiceAbstract.h"
#import "MSACWrapperLogger.h"
#import "MSACWrapperSdk.h"
#endif
@@ -1,14 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_ABSTRACT_LOG_H
#define MSAC_ABSTRACT_LOG_H
#import <Foundation/Foundation.h>
NS_SWIFT_NAME(AbstractLog)
@interface MSACAbstractLog : NSObject
@end
#endif
@@ -1,203 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_APP_CENTER
#define MSAC_APP_CENTER
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
@class MSACWrapperSdk;
#if !TARGET_OS_TV
@class MSACCustomProperties;
#endif
NS_SWIFT_NAME(AppCenter)
@interface MSACAppCenter : NSObject
/**
* Returns the singleton instance of MSACAppCenter.
*/
+ (instancetype)sharedInstance;
/**
* Configure the SDK with an application secret.
*
* @param appSecret A unique and secret key used to identify the application.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configureWithAppSecret:(NSString *)appSecret NS_SWIFT_NAME(configure(withAppSecret:));
/**
* Configure the SDK.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configure;
/**
* Configure the SDK with an application secret and an array of services to start.
*
* @param appSecret A unique and secret key used to identify the application.
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)start:(NSString *)appSecret withServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(withAppSecret:services:));
/**
* Start the SDK with an array of services.
*
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)startWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(services:));
/**
* Start a service.
*
* @param service A service to start.
*
* @discussion This may be called only once per service per application process lifetime.
*/
+ (void)startService:(Class)service;
/**
* Configure the SDK with an array of services to start from a library. This will not start the service at application level, it will enable
* the service only for the library.
*
* @param services Array of services to start.
*/
+ (void)startFromLibraryWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(startFromLibrary(services:));
/**
* The flag indicates whether the SDK has already been configured or not.
*/
@property(class, atomic, readonly, getter=isConfigured) BOOL configured;
/**
* The flag indicates whether app is running in App Center Test Cloud.
*/
@property(class, atomic, readonly, getter=isRunningInAppCenterTestCloud) BOOL runningInAppCenterTestCloud;
/**
* The flag indicates whether or not the SDK was enabled as a whole
*
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
/**
* Flag indicating whether SDK can send network requests.
*
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isNetworkRequestsAllowed, setter=setNetworkRequestsAllowed:)
BOOL networkRequestsAllowed NS_SWIFT_NAME(networkRequestsAllowed);
/**
* The SDK's log level.
*/
@property(class, nonatomic) MSACLogLevel logLevel;
/**
* Base URL to use for backend communication.
*/
@property(class, nonatomic, strong) NSString *logUrl;
/**
* Set log handler.
*/
@property(class, nonatomic) MSACLogHandler logHandler;
/**
* Set wrapper SDK information to use when building device properties. This is intended in case you are building a SDK that uses the App
* Center SDK under the hood, e.g. our Xamarin SDK or ReactNative SDk.
*/
@property(class, nonatomic, strong) MSACWrapperSdk *wrapperSdk;
#if !TARGET_OS_TV
/**
* Set the custom properties.
*
* @param customProperties Custom properties object.
*/
+ (void)setCustomProperties:(MSACCustomProperties *)customProperties;
#endif
/**
* Check whether the application delegate forwarder is enabled or not.
*
* @discussion The application delegate forwarder forwards messages that target your application delegate methods via swizzling to the SDK.
* It simplifies the SDK integration but may not be suitable to any situations. For
* instance it should be disabled if you or one of your third party SDK is doing message forwarding on the application delegate. Message
* forwarding usually implies the implementation of @see NSObject#forwardingTargetForSelector: or @see NSObject#forwardInvocation: methods.
* To disable the application delegate forwarder just add the `AppCenterAppDelegateForwarderEnabled` tag to your Info .plist file and set it
* to `0`. Then you will have to forward any application delegate needed by the SDK manually.
*/
@property(class, readonly, nonatomic, getter=isAppDelegateForwarderEnabled) BOOL appDelegateForwarderEnabled;
/**
* Unique installation identifier.
*
*/
@property(class, readonly, nonatomic) NSUUID *installId;
/**
* Detect if a debugger is attached to the app process. This is only invoked once on app startup and can not detect
* if the debugger is being attached during runtime!
*
*/
@property(class, readonly, nonatomic, getter=isDebuggerAttached) BOOL debuggerAttached;
/**
* Current version of AppCenter SDK.
*
*/
@property(class, readonly, nonatomic) NSString *sdkVersion;
/**
* Set the maximum size of the internal storage. This method must be called before App Center is started. This method is only intended for
* applications.
*
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
* (default is 4096 bytes). Values below 20,480 bytes (20 KiB) will be ignored.
*
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
* is successful, and `NO` otherwise. This parameter can be null.
*
* @discussion This only sets the maximum size of the database, but App Center modules might store additional data.
* The value passed to this method is not persisted on disk. The default maximum database size is 10485760 bytes (10 MiB).
*/
+ (void)setMaxStorageSize:(long)sizeInBytes completionHandler:(void (^)(BOOL))completionHandler;
/**
* Set the user identifier.
*
* @discussion Set the user identifier for logs sent for the default target token when the secret passed in @c
* MSACAppCenter:start:withServices: contains "target={targetToken}".
*
* For App Center backend the user identifier maximum length is 256 characters.
*
* AppCenter must be configured or started before this API can be used.
*/
@property(class, nonatomic, strong) NSString *userId;
/**
* Set country code to use when building device properties.
*
* @see https://www.iso.org/obp/ui/#search for more information.
*/
@property(class, nonatomic, strong) NSString *countryCode;
@end
#endif
@@ -1,41 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_APP_CENTER_ERRORS_H
#define MSAC_APP_CENTER_ERRORS_H
#import <Foundation/Foundation.h>
#define MSAC_APP_CENTER_BASE_DOMAIN @"com.Microsoft.AppCenter."
NS_ASSUME_NONNULL_BEGIN
#pragma mark - Domain
static NSString *const kMSACACErrorDomain = MSAC_APP_CENTER_BASE_DOMAIN @"ErrorDomain";
#pragma mark - General
// Error codes.
NS_ENUM(NSInteger){MSACACLogInvalidContainerErrorCode = 1, MSACACCanceledErrorCode = 2, MSACACDisabledErrorCode = 3};
// Error descriptions.
static NSString const *kMSACACLogInvalidContainerErrorDesc = @"Invalid log container.";
static NSString const *kMSACACCanceledErrorDesc = @"The operation was canceled.";
static NSString const *kMSACACDisabledErrorDesc = @"The service is disabled.";
#pragma mark - Connection
// Error codes.
NS_ENUM(NSInteger){MSACACConnectionPausedErrorCode = 100, MSACACConnectionHttpErrorCode = 101};
// Error descriptions.
static NSString const *kMSACACConnectionHttpErrorDesc = @"An HTTP error occured.";
static NSString const *kMSACACConnectionPausedErrorDesc = @"Canceled, connection paused with log deletion.";
// Error user info keys.
static NSString const *kMSACACConnectionHttpCodeErrorKey = @"MSConnectionHttpCode";
NS_ASSUME_NONNULL_END
#endif
@@ -1,87 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CHANNEL_GROUP_PROTOCOL_H
#define MSAC_CHANNEL_GROUP_PROTOCOL_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACChannelProtocol.h>)
#import <AppCenter/MSACChannelProtocol.h>
#else
#import "MSACChannelProtocol.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@class MSACChannelUnitConfiguration;
@protocol MSACIngestionProtocol;
@protocol MSACChannelUnitProtocol;
/**
* `MSACChannelGroupProtocol` represents a kind of channel that contains constituent MSACChannelUnit objects. When an operation from the
* `MSACChannelProtocol` is performed on the group, that operation should be propagated to its constituent MSACChannelUnit objects.
*/
NS_SWIFT_NAME(ChannelGroupProtocol)
@protocol MSACChannelGroupProtocol <MSACChannelProtocol>
/**
* Initialize a channel unit with the given configuration.
*
* @param configuration channel configuration.
*
* @return The added `MSACChannelUnitProtocol`. Use this object to enqueue logs.
*/
- (id<MSACChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSACChannelUnitConfiguration *)configuration
NS_SWIFT_NAME(addChannelUnit(withConfiguration:));
/**
* Initialize a channel unit with the given configuration.
*
* @param configuration channel configuration.
* @param ingestion The alternative ingestion object
*
* @return The added `MSACChannelUnitProtocol`. Use this object to enqueue logs.
*/
- (id<MSACChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSACChannelUnitConfiguration *)configuration
withIngestion:(nullable id<MSACIngestionProtocol>)ingestion
NS_SWIFT_NAME(addChannelUnit(_:ingestion:));
/**
* Change the base URL (schema + authority + port only) used to communicate with the backend.
*/
@property(nonatomic, strong) NSString *_Nullable logUrl;
/**
* Set the app secret.
*/
@property(nonatomic, strong) NSString *_Nullable appSecret;
/**
* Set the maximum size of the internal storage. This method must be called before App Center is started.
*
* @discussion The default maximum database size is 10485760 bytes (10 MiB).
*
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
* (default is 4096 bytes). Values below 24576 bytes (24 KiB) will be ignored.
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
* is successful, and `NO` otherwise.
*/
- (void)setMaxStorageSize:(long)sizeInBytes
completionHandler:(nullable void (^)(BOOL))completionHandler NS_SWIFT_NAME(setMaxStorageSize(_:completionHandler:));
/**
* Return a channel unit instance for the given groupId.
*
* @param groupId The group ID for a channel unit.
*
* @return A channel unit instance or `nil`.
*/
- (nullable id<MSACChannelUnitProtocol>)channelUnitForGroupId:(NSString *)groupId;
@end
NS_ASSUME_NONNULL_END
#endif
@@ -1,68 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CHANNEL_PROTOCOL_H
#define MSAC_CHANNEL_PROTOCOL_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACEnable.h>)
#import <AppCenter/MSACEnable.h>
#else
#import "MSACEnable.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@protocol MSACChannelDelegate;
/**
* `MSACChannelProtocol` contains the essential operations of a channel. Channels are broadly responsible for enqueuing logs to be sent to
* the backend and/or stored on disk.
*/
NS_SWIFT_NAME(ChannelProtocol)
@protocol MSACChannelProtocol <NSObject, MSACEnable>
/**
* Add delegate.
*
* @param delegate delegate.
*/
- (void)addDelegate:(id<MSACChannelDelegate>)delegate;
/**
* Remove delegate.
*
* @param delegate delegate.
*/
- (void)removeDelegate:(id<MSACChannelDelegate>)delegate;
/**
* Pause operations, logs will be stored but not sent.
*
* @param identifyingObject Object used to identify the pause request.
*
* @discussion A paused channel doesn't forward logs to the ingestion. The identifying object used to pause the channel can be any unique
* object. The same identifying object must be used to call resume. For simplicity if the caller is the one owning the channel then @c self
* can be used as identifying object.
*
* @see resumeWithIdentifyingObject:
*/
- (void)pauseWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* Resume operations, logs can be sent again.
*
* @param identifyingObject Object used to passed to the pause method.
*
* @discussion The channel only resume when all the outstanding identifying objects have been resumed.
*
* @see pauseWithIdentifyingObject:
*/
- (void)resumeWithIdentifyingObject:(id<NSObject>)identifyingObject;
@end
NS_ASSUME_NONNULL_END
#endif
@@ -1,18 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CONSTANTS_FLAGS_H
#define MSAC_CONSTANTS_FLAGS_H
#import <Foundation/Foundation.h>
typedef NS_OPTIONS(NSUInteger, MSACFlags) {
MSACFlagsNone = (0 << 0), // => 00000000
MSACFlagsNormal = (1 << 0), // => 00000001
MSACFlagsCritical = (1 << 1), // => 00000010
MSACFlagsPersistenceNormal DEPRECATED_MSG_ATTRIBUTE("please use MSACFlagsNormal") = MSACFlagsNormal,
MSACFlagsPersistenceCritical DEPRECATED_MSG_ATTRIBUTE("please use MSACFlagsCritical") = MSACFlagsCritical,
MSACFlagsDefault = MSACFlagsNormal
} NS_SWIFT_NAME(Flags);
#endif
@@ -1,170 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
/**
* Log Levels
*/
typedef NS_ENUM(NSUInteger, MSACLogLevel) {
/**
* Logging will be very chatty
*/
MSACLogLevelVerbose = 2,
/**
* Debug information will be logged
*/
MSACLogLevelDebug = 3,
/**
* Information will be logged
*/
MSACLogLevelInfo = 4,
/**
* Errors and warnings will be logged
*/
MSACLogLevelWarning = 5,
/**
* Errors will be logged
*/
MSACLogLevelError = 6,
/**
* Only critical errors will be logged
*/
MSACLogLevelAssert = 7,
/**
* Logging is disabled
*/
MSACLogLevelNone = 99
} NS_SWIFT_NAME(LogLevel);
typedef NSString * (^MSACLogMessageProvider)(void)NS_SWIFT_NAME(LogMessageProvider);
typedef void (^MSACLogHandler)(MSACLogMessageProvider messageProvider, MSACLogLevel logLevel, NSString *tag, const char *file,
const char *function, uint line) NS_SWIFT_NAME(LogHandler);
/**
* Channel priorities, check the kMSACPriorityCount if you add a new value.
* The order matters here! Values NEED to range from low priority to high priority.
*/
typedef NS_ENUM(NSInteger, MSACPriority) { MSACPriorityBackground, MSACPriorityDefault, MSACPriorityHigh } NS_SWIFT_NAME(Priority);
static short const kMSACPriorityCount = MSACPriorityHigh + 1;
/**
* The priority by which the modules are initialized.
* MSACPriorityMax is reserved for only 1 module and this needs to be Crashes.
* Crashes needs to be initialized first to catch crashes in our other SDK Modules (which will hopefully never happen) and to avoid losing
* any log at crash time.
*/
typedef NS_ENUM(NSInteger, MSACInitializationPriority) {
MSACInitializationPriorityDefault = 500,
MSACInitializationPriorityHigh = 750,
MSACInitializationPriorityMax = 999
} NS_SWIFT_NAME(InitializationPriority);
/**
* Enum with the different HTTP status codes.
*/
typedef NS_ENUM(NSInteger, MSACHTTPCodesNo) {
// Invalid
MSACHTTPCodesNo0XXInvalidUnknown = 0,
// Informational
MSACHTTPCodesNo1XXInformationalUnknown = 1,
MSACHTTPCodesNo100Continue = 100,
MSACHTTPCodesNo101SwitchingProtocols = 101,
MSACHTTPCodesNo102Processing = 102,
// Success
MSACHTTPCodesNo2XXSuccessUnknown = 2,
MSACHTTPCodesNo200OK = 200,
MSACHTTPCodesNo201Created = 201,
MSACHTTPCodesNo202Accepted = 202,
MSACHTTPCodesNo203NonAuthoritativeInformation = 203,
MSACHTTPCodesNo204NoContent = 204,
MSACHTTPCodesNo205ResetContent = 205,
MSACHTTPCodesNo206PartialContent = 206,
MSACHTTPCodesNo207MultiStatus = 207,
MSACHTTPCodesNo208AlreadyReported = 208,
MSACHTTPCodesNo209IMUsed = 209,
// Redirection
MSACHTTPCodesNo3XXSuccessUnknown = 3,
MSACHTTPCodesNo300MultipleChoices = 300,
MSACHTTPCodesNo301MovedPermanently = 301,
MSACHTTPCodesNo302Found = 302,
MSACHTTPCodesNo303SeeOther = 303,
MSACHTTPCodesNo304NotModified = 304,
MSACHTTPCodesNo305UseProxy = 305,
MSACHTTPCodesNo306SwitchProxy = 306,
MSACHTTPCodesNo307TemporaryRedirect = 307,
MSACHTTPCodesNo308PermanentRedirect = 308,
// Client error
MSACHTTPCodesNo4XXSuccessUnknown = 4,
MSACHTTPCodesNo400BadRequest = 400,
MSACHTTPCodesNo401Unauthorised = 401,
MSACHTTPCodesNo402PaymentRequired = 402,
MSACHTTPCodesNo403Forbidden = 403,
MSACHTTPCodesNo404NotFound = 404,
MSACHTTPCodesNo405MethodNotAllowed = 405,
MSACHTTPCodesNo406NotAcceptable = 406,
MSACHTTPCodesNo407ProxyAuthenticationRequired = 407,
MSACHTTPCodesNo408RequestTimeout = 408,
MSACHTTPCodesNo409Conflict = 409,
MSACHTTPCodesNo410Gone = 410,
MSACHTTPCodesNo411LengthRequired = 411,
MSACHTTPCodesNo412PreconditionFailed = 412,
MSACHTTPCodesNo413RequestEntityTooLarge = 413,
MSACHTTPCodesNo414RequestURITooLong = 414,
MSACHTTPCodesNo415UnsupportedMediaType = 415,
MSACHTTPCodesNo416RequestedRangeNotSatisfiable = 416,
MSACHTTPCodesNo417ExpectationFailed = 417,
MSACHTTPCodesNo418IamATeapot = 418,
MSACHTTPCodesNo419AuthenticationTimeout = 419,
MSACHTTPCodesNo420MethodFailureSpringFramework = 420,
MSACHTTPCodesNo420EnhanceYourCalmTwitter = 4200,
MSACHTTPCodesNo422UnprocessableEntity = 422,
MSACHTTPCodesNo423Locked = 423,
MSACHTTPCodesNo424FailedDependency = 424,
MSACHTTPCodesNo424MethodFailureWebDaw = 4240,
MSACHTTPCodesNo425UnorderedCollection = 425,
MSACHTTPCodesNo426UpgradeRequired = 426,
MSACHTTPCodesNo428PreconditionRequired = 428,
MSACHTTPCodesNo429TooManyRequests = 429,
MSACHTTPCodesNo431RequestHeaderFieldsTooLarge = 431,
MSACHTTPCodesNo444NoResponseNginx = 444,
MSACHTTPCodesNo449RetryWithMicrosoft = 449,
MSACHTTPCodesNo450BlockedByWindowsParentalControls = 450,
MSACHTTPCodesNo451RedirectMicrosoft = 451,
MSACHTTPCodesNo451UnavailableForLegalReasons = 4510,
MSACHTTPCodesNo494RequestHeaderTooLargeNginx = 494,
MSACHTTPCodesNo495CertErrorNginx = 495,
MSACHTTPCodesNo496NoCertNginx = 496,
MSACHTTPCodesNo497HTTPToHTTPSNginx = 497,
MSACHTTPCodesNo499ClientClosedRequestNginx = 499,
// Server error
MSACHTTPCodesNo5XXSuccessUnknown = 5,
MSACHTTPCodesNo500InternalServerError = 500,
MSACHTTPCodesNo501NotImplemented = 501,
MSACHTTPCodesNo502BadGateway = 502,
MSACHTTPCodesNo503ServiceUnavailable = 503,
MSACHTTPCodesNo504GatewayTimeout = 504,
MSACHTTPCodesNo505HTTPVersionNotSupported = 505,
MSACHTTPCodesNo506VariantAlsoNegotiates = 506,
MSACHTTPCodesNo507InsufficientStorage = 507,
MSACHTTPCodesNo508LoopDetected = 508,
MSACHTTPCodesNo509BandwidthLimitExceeded = 509,
MSACHTTPCodesNo510NotExtended = 510,
MSACHTTPCodesNo511NetworkAuthenticationRequired = 511,
MSACHTTPCodesNo522ConnectionTimedOut = 522,
MSACHTTPCodesNo598NetworkReadTimeoutErrorUnknown = 598,
MSACHTTPCodesNo599NetworkConnectTimeoutErrorUnknown = 599
} NS_SWIFT_NAME(HTTPCodesNo);
@@ -1,71 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CUSTOM_PROPERTIES_H
#define MSAC_CUSTOM_PROPERTIES_H
#import <Foundation/Foundation.h>
/**
* Custom properties builder.
* Collects multiple properties to send in one log.
*/
NS_SWIFT_NAME(CustomProperties)
@interface MSACCustomProperties : NSObject
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setString:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setNumber:(NSNumber *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setBool:(BOOL)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setDate:(NSDate *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Clear the property for the specified key.
*
* @param key Key whose mapping is to be cleared.
*
* @return This instance.
*/
- (instancetype)clearPropertyForKey:(NSString *)key NS_SWIFT_NAME(clearProperty(forKey:));
@end
#endif
@@ -1,101 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_DEVICE_H
#define MSAC_DEVICE_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACWrapperSdk.h>)
#import <AppCenter/MSACWrapperSdk.h>
#else
#import "MSACWrapperSdk.h"
#endif
NS_SWIFT_NAME(Device)
@interface MSACDevice : MSACWrapperSdk
/*
* Name of the SDK. Consists of the name of the SDK and the platform, e.g. "appcenter.ios", "appcenter.android"
*/
@property(nonatomic, copy, readonly) NSString *sdkName;
/*
* Version of the SDK in semver format, e.g. "1.2.0" or "0.12.3-alpha.1".
*/
@property(nonatomic, copy, readonly) NSString *sdkVersion;
/*
* Device model (example: iPad2,3).
*/
@property(nonatomic, copy, readonly) NSString *model;
/*
* Device manufacturer (example: HTC).
*/
@property(nonatomic, copy, readonly) NSString *oemName;
/*
* OS name (example: iOS).
*/
@property(nonatomic, copy, readonly) NSString *osName;
/*
* OS version (example: 9.3.0).
*/
@property(nonatomic, copy, readonly) NSString *osVersion;
/*
* OS build code (example: LMY47X). [optional]
*/
@property(nonatomic, copy, readonly) NSString *osBuild;
/*
* API level when applicable like in Android (example: 15). [optional]
*/
@property(nonatomic, copy, readonly) NSNumber *osApiLevel;
/*
* Language code (example: en_US).
*/
@property(nonatomic, copy, readonly) NSString *locale;
/*
* The offset in minutes from UTC for the device time zone, including daylight savings time.
*/
@property(nonatomic, readonly, strong) NSNumber *timeZoneOffset;
/*
* Screen size of the device in pixels (example: 640x480).
*/
@property(nonatomic, copy, readonly) NSString *screenSize;
/*
* Application version name, e.g. 1.1.0
*/
@property(nonatomic, copy, readonly) NSString *appVersion;
/*
* Carrier name (for mobile devices). [optional]
*/
@property(nonatomic, copy, readonly) NSString *carrierName;
/*
* Carrier country code (for mobile devices). [optional]
*/
@property(nonatomic, copy, readonly) NSString *carrierCountry;
/*
* The app's build number, e.g. 42.
*/
@property(nonatomic, copy, readonly) NSString *appBuild;
/*
* The bundle identifier, package identifier, or namespace, depending on what the individual plattforms use, .e.g com.microsoft.example.
* [optional]
*/
@property(nonatomic, copy, readonly) NSString *appNamespace;
@end
#endif
@@ -1,27 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_ENABLE_H
#define MSAC_ENABLE_H
#import <Foundation/Foundation.h>
/**
* Protocol to define an instance that can be enabled/disabled.
*/
NS_SWIFT_NAME(Enable)
@protocol MSACEnable <NSObject>
@required
/**
* Enable/disable this instance and delete data on disabled state.
*
* @param isEnabled A boolean value set to YES to enable the instance or NO to disable it.
* @param deleteData A boolean value set to YES to delete data or NO to keep it.
*/
- (void)setEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deleteData NS_SWIFT_NAME(setEnabled(_:deleteDataOnDisabled:));
@end
#endif
@@ -1,74 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_LOG_H
#define MSAC_LOG_H
#import <Foundation/Foundation.h>
@class MSACDevice;
NS_SWIFT_NAME(Log)
@protocol MSACLog <NSObject>
/**
* Log type.
*/
@property(nonatomic, copy) NSString *type;
/**
* Log timestamp.
*/
@property(nonatomic, strong) NSDate *timestamp;
/**
* A session identifier is used to correlate logs together. A session is an abstract concept in the API and is not necessarily an analytics
* session, it can be used to only track crashes.
*/
@property(nonatomic, copy) NSString *sid;
/**
* Optional distribution group ID value.
*/
@property(nonatomic, copy) NSString *distributionGroupId;
/**
* Optional user identifier.
*/
@property(nonatomic, copy) NSString *userId;
/**
* Device properties associated to this log.
*/
@property(nonatomic, strong) MSACDevice *device;
/**
* Transient object tag. For example, a log can be tagged with a transmission target. We do this currently to prevent properties being
* applied retroactively to previous logs by comparing their tags.
*/
@property(nonatomic, strong) NSObject *tag;
/**
* Checks if the object's values are valid.
*
* @return YES, if the object is valid.
*/
- (BOOL)isValid;
/**
* Adds a transmission target token that this log should be sent to.
*
* @param token The transmission target token.
*/
- (void)addTransmissionTargetToken:(NSString *)token;
/**
* Gets all transmission target tokens that this log should be sent to.
*
* @returns Collection of transmission target tokens that this log should be sent to.
*/
- (NSSet *)transmissionTargetTokens;
@end
#endif
@@ -1,25 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_LOG_WITH_PROPERTIES_H
#define MSAC_LOG_WITH_PROPERTIES_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACAbstractLog.h>)
#import <AppCenter/MSACAbstractLog.h>
#else
#import "MSACAbstractLog.h"
#endif
NS_SWIFT_NAME(LogWithProperties)
@interface MSACLogWithProperties : MSACAbstractLog
/**
* Additional key/value pair parameters. [optional]
*/
@property(nonatomic, strong) NSDictionary<NSString *, NSString *> *properties;
@end
#endif
@@ -1,54 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_LOGGER
#define MSAC_LOGGER
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
#define MSACLog(_level, _tag, _message) \
[MSACLogger logMessage:_message level:_level tag:_tag file:__FILE__ function:__PRETTY_FUNCTION__ line:__LINE__]
#define MSACLogAssert(tag, format, ...) \
MSACLog(MSACLogLevelAssert, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogError(tag, format, ...) \
MSACLog(MSACLogLevelError, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogWarning(tag, format, ...) \
MSACLog(MSACLogLevelWarning, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogInfo(tag, format, ...) \
MSACLog(MSACLogLevelInfo, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogDebug(tag, format, ...) \
MSACLog(MSACLogLevelDebug, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogVerbose(tag, format, ...) \
MSACLog(MSACLogLevelVerbose, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
NS_SWIFT_NAME(Logger)
@interface MSACLogger : NSObject
+ (void)logMessage:(MSACLogMessageProvider)messageProvider
level:(MSACLogLevel)loglevel
tag:(NSString *)tag
file:(const char *)file
function:(const char *)function
line:(uint)line;
@end
#endif
@@ -1,19 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef SERIALIZABLE_OBJECT_H
#define SERIALIZABLE_OBJECT_H
@protocol MSACSerializableObject <NSCoding>
/**
* Serialize this object to a dictionary.
*
* @return A dictionary representing this object.
*/
- (NSMutableDictionary *)serializeToDictionary;
@end
#endif
@@ -1,23 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_SERVICE_H
#define MSAC_SERVICE_H
#import <Foundation/Foundation.h>
/**
* Protocol declaring service logic.
*/
NS_SWIFT_NAME(Service)
@protocol MSACService <NSObject>
/**
* Indicates whether this service is enabled.
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
@end
#endif
@@ -1,58 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_SERVICE_ABSTRACT_H
#define MSAC_SERVICE_ABSTRACT_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACService.h>)
#import <AppCenter/MSACService.h>
#else
#import "MSACService.h"
#endif
@protocol MSACChannelGroupProtocol;
/**
* Abstraction of services common logic.
* This class is intended to be subclassed only not instantiated directly.
*/
NS_SWIFT_NAME(ServiceAbstract)
@interface MSACServiceAbstract : NSObject <MSACService>
/**
* The flag indicates whether the service is started from application or not.
*/
@property(nonatomic, assign) BOOL startedFromApplication;
/**
* Start this service with a channel group. Also sets the flag that indicates that a service has been started.
*
* @param channelGroup channel group used to persist and send logs.
* @param appSecret app secret for the SDK.
* @param token default transmission target token for this service.
* @param fromApplication indicates whether the service started from an application or not.
*/
- (void)startWithChannelGroup:(id<MSACChannelGroupProtocol>)channelGroup
appSecret:(NSString *)appSecret
transmissionTargetToken:(NSString *)token
fromApplication:(BOOL)fromApplication;
/**
* Update configuration when the service requires to start again. This method should only be called if the service is started from libraries
* and then is being started from an application.
*
* @param appSecret app secret for the SDK.
* @param token default transmission target token for this service.
*/
- (void)updateConfigurationWithAppSecret:(NSString *)appSecret transmissionTargetToken:(NSString *)token;
/**
* The flag indicate whether the service needs the application secret or not.
*/
@property(atomic, readonly) BOOL isAppSecretRequired;
@end
#endif
@@ -1,21 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
/**
* This is a utility for producing App Center style log messages. It is only intended for use by App Center services and wrapper SDKs of App
* Center.
*/
NS_SWIFT_NAME(WrapperLogger)
@interface MSACWrapperLogger : NSObject
+ (void)MSACWrapperLog:(MSACLogMessageProvider)message tag:(NSString *)tag level:(MSACLogLevel)level;
@end
@@ -1,60 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_WRAPPER_SDK_H
#define MSAC_WRAPPER_SDK_H
#import <Foundation/Foundation.h>
NS_SWIFT_NAME(WrapperSdk)
@interface MSACWrapperSdk : NSObject
/*
* Version of the wrapper SDK. When the SDK is embedding another base SDK (for example Xamarin.Android wraps Android), the Xamarin specific
* version is populated into this field while sdkVersion refers to the original Android SDK. [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperSdkVersion;
/*
* Name of the wrapper SDK (examples: Xamarin, Cordova). [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperSdkName;
/*
* Version of the wrapper technology framework (Xamarin runtime version or ReactNative or Cordova etc...). [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperRuntimeVersion;
/*
* Label that is used to identify application code 'version' released via Live Update beacon running on device.
*/
@property(nonatomic, copy, readonly) NSString *liveUpdateReleaseLabel;
/*
* Identifier of environment that current application release belongs to, deployment key then maps to environment like Production, Staging.
*/
@property(nonatomic, copy, readonly) NSString *liveUpdateDeploymentKey;
/*
* Hash of all files (ReactNative or Cordova) deployed to device via LiveUpdate beacon. Helps identify the Release version on device or need
* to download updates in future
*/
@property(nonatomic, copy, readonly) NSString *liveUpdatePackageHash;
- (instancetype)initWithWrapperSdkVersion:(NSString *)wrapperSdkVersion
wrapperSdkName:(NSString *)wrapperSdkName
wrapperRuntimeVersion:(NSString *)wrapperRuntimeVersion
liveUpdateReleaseLabel:(NSString *)liveUpdateReleaseLabel
liveUpdateDeploymentKey:(NSString *)liveUpdateDeploymentKey
liveUpdatePackageHash:(NSString *)liveUpdatePackageHash;
/**
* Checks if the object's values are valid.
*
* @return YES, if the object is valid.
*/
- (BOOL)isValid;
@end
#endif
@@ -1,13 +0,0 @@
framework module AppCenter {
umbrella header "AppCenter.h"
export *
module * { export * }
link framework "Foundation"
link framework "CoreTelephony"
link framework "SystemConfiguration"
link framework "UIKit"
link "sqlite3"
link "z"
}
@@ -1,114 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#import "MSACConstants+Flags.h"
@protocol MSACChannelUnitProtocol;
@protocol MSACChannelGroupProtocol;
@protocol MSACChannelProtocol;
@protocol MSACLog;
NS_ASSUME_NONNULL_BEGIN
@protocol MSACChannelDelegate <NSObject>
@optional
/**
* A callback that is called when a channel unit is added to the channel group.
*
* @param channelGroup The channel group.
* @param channel The newly added channel.
*/
- (void)channelGroup:(id<MSACChannelGroupProtocol>)channelGroup didAddChannelUnit:(id<MSACChannelUnitProtocol>)channel;
/**
* A callback that is called when a log is just enqueued. Delegates may want to prepare the log a little more before further processing.
*
* @param log The log to prepare.
*/
- (void)channel:(id<MSACChannelProtocol>)channel prepareLog:(id<MSACLog>)log;
/**
* A callback that is called after a log is definitely prepared.
*
* @param log The log.
* @param internalId An internal Id to keep track of logs.
* @param flags Options for the log.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didPrepareLog:(id<MSACLog>)log internalId:(NSString *)internalId flags:(MSACFlags)flags;
/**
* A callback that is called after a log completed the enqueueing process whether it was successful or not.
*
* @param log The log.
* @param internalId An internal Id to keep track of logs.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didCompleteEnqueueingLog:(id<MSACLog>)log internalId:(NSString *)internalId;
/**
* Callback method that will be called before each log will be send to the server.
*
* @param channel The channel object.
* @param log The log to be sent.
*/
- (void)channel:(id<MSACChannelProtocol>)channel willSendLog:(id<MSACLog>)log;
/**
* Callback method that will be called in case the SDK was able to send a log.
*
* @param channel The channel object.
* @param log The log to be sent.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didSucceedSendingLog:(id<MSACLog>)log;
/**
* Callback method that will be called in case the SDK was unable to send a log.
*
* @param channel The channel object.
* @param log The log to be sent.
* @param error The error that occured.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didFailSendingLog:(id<MSACLog>)log withError:(nullable NSError *)error;
/**
* A callback that is called when setEnabled has been invoked.
*
* @param channel The channel.
* @param isEnabled The boolean that indicates enabled.
* @param deletedData The boolean that indicates deleting data on disabled.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didSetEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deletedData;
/**
* A callback that is called when pause has been invoked.
*
* @param channel The channel.
* @param identifyingObject The identifying object used to pause the channel.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didPauseWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* A callback that is called when resume has been invoked.
*
* @param channel The channel.
* @param identifyingObject The identifying object used to resume the channel.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didResumeWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* Callback method that will determine if a log should be filtered out from the usual processing pipeline. If any delegate returns true, the
* log is filtered.
*
* @param channelUnit The channel unit that is going to send the log.
* @param log The log to be filtered or not.
*
* @return `true` if the log should be filtered out.
*/
- (BOOL)channelUnit:(id<MSACChannelUnitProtocol>)channelUnit shouldFilterLog:(id<MSACLog>)log;
@end
NS_ASSUME_NONNULL_END
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19H1323</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>AppCenter</string>
<key>CFBundleIdentifier</key>
<string>com.microsoft.appcenter</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AppCenter</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>11C505</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>19B90</string>
<key>DTSDKName</key>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1130</string>
<key>DTXcodeBuild</key>
<string>11C505</string>
<key>LSMinimumSystemVersion</key>
<string>10.15</string>
<key>UIDeviceFamily</key>
<array>
<integer>2</integer>
</array>
</dict>
</plist>
@@ -1 +0,0 @@
Versions/Current/AppCenter
@@ -1 +0,0 @@
Versions/Current/Headers
@@ -1 +0,0 @@
Versions/Current/Modules
@@ -1 +0,0 @@
Versions/Current/PrivateHeaders
@@ -1 +0,0 @@
Versions/Current/Resources
@@ -1,44 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACAppCenter.h>)
#import <AppCenter/MSACAbstractLog.h>
#import <AppCenter/MSACAppCenter.h>
#import <AppCenter/MSACAppCenterErrors.h>
#import <AppCenter/MSACChannelGroupProtocol.h>
#import <AppCenter/MSACChannelProtocol.h>
#import <AppCenter/MSACConstants+Flags.h>
#import <AppCenter/MSACConstants.h>
#import <AppCenter/MSACCustomProperties.h>
#import <AppCenter/MSACDevice.h>
#import <AppCenter/MSACEnable.h>
#import <AppCenter/MSACLog.h>
#import <AppCenter/MSACLogWithProperties.h>
#import <AppCenter/MSACLogger.h>
#import <AppCenter/MSACSerializableObject.h>
#import <AppCenter/MSACService.h>
#import <AppCenter/MSACServiceAbstract.h>
#import <AppCenter/MSACWrapperLogger.h>
#import <AppCenter/MSACWrapperSdk.h>
#else
#import "MSACAbstractLog.h"
#import "MSACAppCenter.h"
#import "MSACAppCenterErrors.h"
#import "MSACChannelGroupProtocol.h"
#import "MSACChannelProtocol.h"
#import "MSACConstants+Flags.h"
#import "MSACConstants.h"
#import "MSACCustomProperties.h"
#import "MSACDevice.h"
#import "MSACEnable.h"
#import "MSACLog.h"
#import "MSACLogWithProperties.h"
#import "MSACLogger.h"
#import "MSACSerializableObject.h"
#import "MSACService.h"
#import "MSACServiceAbstract.h"
#import "MSACWrapperLogger.h"
#import "MSACWrapperSdk.h"
#endif
@@ -1,203 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_APP_CENTER
#define MSAC_APP_CENTER
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
@class MSACWrapperSdk;
#if !TARGET_OS_TV
@class MSACCustomProperties;
#endif
NS_SWIFT_NAME(AppCenter)
@interface MSACAppCenter : NSObject
/**
* Returns the singleton instance of MSACAppCenter.
*/
+ (instancetype)sharedInstance;
/**
* Configure the SDK with an application secret.
*
* @param appSecret A unique and secret key used to identify the application.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configureWithAppSecret:(NSString *)appSecret NS_SWIFT_NAME(configure(withAppSecret:));
/**
* Configure the SDK.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configure;
/**
* Configure the SDK with an application secret and an array of services to start.
*
* @param appSecret A unique and secret key used to identify the application.
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)start:(NSString *)appSecret withServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(withAppSecret:services:));
/**
* Start the SDK with an array of services.
*
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)startWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(services:));
/**
* Start a service.
*
* @param service A service to start.
*
* @discussion This may be called only once per service per application process lifetime.
*/
+ (void)startService:(Class)service;
/**
* Configure the SDK with an array of services to start from a library. This will not start the service at application level, it will enable
* the service only for the library.
*
* @param services Array of services to start.
*/
+ (void)startFromLibraryWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(startFromLibrary(services:));
/**
* The flag indicates whether the SDK has already been configured or not.
*/
@property(class, atomic, readonly, getter=isConfigured) BOOL configured;
/**
* The flag indicates whether app is running in App Center Test Cloud.
*/
@property(class, atomic, readonly, getter=isRunningInAppCenterTestCloud) BOOL runningInAppCenterTestCloud;
/**
* The flag indicates whether or not the SDK was enabled as a whole
*
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
/**
* Flag indicating whether SDK can send network requests.
*
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isNetworkRequestsAllowed, setter=setNetworkRequestsAllowed:)
BOOL networkRequestsAllowed NS_SWIFT_NAME(networkRequestsAllowed);
/**
* The SDK's log level.
*/
@property(class, nonatomic) MSACLogLevel logLevel;
/**
* Base URL to use for backend communication.
*/
@property(class, nonatomic, strong) NSString *logUrl;
/**
* Set log handler.
*/
@property(class, nonatomic) MSACLogHandler logHandler;
/**
* Set wrapper SDK information to use when building device properties. This is intended in case you are building a SDK that uses the App
* Center SDK under the hood, e.g. our Xamarin SDK or ReactNative SDk.
*/
@property(class, nonatomic, strong) MSACWrapperSdk *wrapperSdk;
#if !TARGET_OS_TV
/**
* Set the custom properties.
*
* @param customProperties Custom properties object.
*/
+ (void)setCustomProperties:(MSACCustomProperties *)customProperties;
#endif
/**
* Check whether the application delegate forwarder is enabled or not.
*
* @discussion The application delegate forwarder forwards messages that target your application delegate methods via swizzling to the SDK.
* It simplifies the SDK integration but may not be suitable to any situations. For
* instance it should be disabled if you or one of your third party SDK is doing message forwarding on the application delegate. Message
* forwarding usually implies the implementation of @see NSObject#forwardingTargetForSelector: or @see NSObject#forwardInvocation: methods.
* To disable the application delegate forwarder just add the `AppCenterAppDelegateForwarderEnabled` tag to your Info .plist file and set it
* to `0`. Then you will have to forward any application delegate needed by the SDK manually.
*/
@property(class, readonly, nonatomic, getter=isAppDelegateForwarderEnabled) BOOL appDelegateForwarderEnabled;
/**
* Unique installation identifier.
*
*/
@property(class, readonly, nonatomic) NSUUID *installId;
/**
* Detect if a debugger is attached to the app process. This is only invoked once on app startup and can not detect
* if the debugger is being attached during runtime!
*
*/
@property(class, readonly, nonatomic, getter=isDebuggerAttached) BOOL debuggerAttached;
/**
* Current version of AppCenter SDK.
*
*/
@property(class, readonly, nonatomic) NSString *sdkVersion;
/**
* Set the maximum size of the internal storage. This method must be called before App Center is started. This method is only intended for
* applications.
*
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
* (default is 4096 bytes). Values below 20,480 bytes (20 KiB) will be ignored.
*
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
* is successful, and `NO` otherwise. This parameter can be null.
*
* @discussion This only sets the maximum size of the database, but App Center modules might store additional data.
* The value passed to this method is not persisted on disk. The default maximum database size is 10485760 bytes (10 MiB).
*/
+ (void)setMaxStorageSize:(long)sizeInBytes completionHandler:(void (^)(BOOL))completionHandler;
/**
* Set the user identifier.
*
* @discussion Set the user identifier for logs sent for the default target token when the secret passed in @c
* MSACAppCenter:start:withServices: contains "target={targetToken}".
*
* For App Center backend the user identifier maximum length is 256 characters.
*
* AppCenter must be configured or started before this API can be used.
*/
@property(class, nonatomic, strong) NSString *userId;
/**
* Set country code to use when building device properties.
*
* @see https://www.iso.org/obp/ui/#search for more information.
*/
@property(class, nonatomic, strong) NSString *countryCode;
@end
#endif
@@ -1,41 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_APP_CENTER_ERRORS_H
#define MSAC_APP_CENTER_ERRORS_H
#import <Foundation/Foundation.h>
#define MSAC_APP_CENTER_BASE_DOMAIN @"com.Microsoft.AppCenter."
NS_ASSUME_NONNULL_BEGIN
#pragma mark - Domain
static NSString *const kMSACACErrorDomain = MSAC_APP_CENTER_BASE_DOMAIN @"ErrorDomain";
#pragma mark - General
// Error codes.
NS_ENUM(NSInteger){MSACACLogInvalidContainerErrorCode = 1, MSACACCanceledErrorCode = 2, MSACACDisabledErrorCode = 3};
// Error descriptions.
static NSString const *kMSACACLogInvalidContainerErrorDesc = @"Invalid log container.";
static NSString const *kMSACACCanceledErrorDesc = @"The operation was canceled.";
static NSString const *kMSACACDisabledErrorDesc = @"The service is disabled.";
#pragma mark - Connection
// Error codes.
NS_ENUM(NSInteger){MSACACConnectionPausedErrorCode = 100, MSACACConnectionHttpErrorCode = 101};
// Error descriptions.
static NSString const *kMSACACConnectionHttpErrorDesc = @"An HTTP error occured.";
static NSString const *kMSACACConnectionPausedErrorDesc = @"Canceled, connection paused with log deletion.";
// Error user info keys.
static NSString const *kMSACACConnectionHttpCodeErrorKey = @"MSConnectionHttpCode";
NS_ASSUME_NONNULL_END
#endif
@@ -1,87 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CHANNEL_GROUP_PROTOCOL_H
#define MSAC_CHANNEL_GROUP_PROTOCOL_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACChannelProtocol.h>)
#import <AppCenter/MSACChannelProtocol.h>
#else
#import "MSACChannelProtocol.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@class MSACChannelUnitConfiguration;
@protocol MSACIngestionProtocol;
@protocol MSACChannelUnitProtocol;
/**
* `MSACChannelGroupProtocol` represents a kind of channel that contains constituent MSACChannelUnit objects. When an operation from the
* `MSACChannelProtocol` is performed on the group, that operation should be propagated to its constituent MSACChannelUnit objects.
*/
NS_SWIFT_NAME(ChannelGroupProtocol)
@protocol MSACChannelGroupProtocol <MSACChannelProtocol>
/**
* Initialize a channel unit with the given configuration.
*
* @param configuration channel configuration.
*
* @return The added `MSACChannelUnitProtocol`. Use this object to enqueue logs.
*/
- (id<MSACChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSACChannelUnitConfiguration *)configuration
NS_SWIFT_NAME(addChannelUnit(withConfiguration:));
/**
* Initialize a channel unit with the given configuration.
*
* @param configuration channel configuration.
* @param ingestion The alternative ingestion object
*
* @return The added `MSACChannelUnitProtocol`. Use this object to enqueue logs.
*/
- (id<MSACChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSACChannelUnitConfiguration *)configuration
withIngestion:(nullable id<MSACIngestionProtocol>)ingestion
NS_SWIFT_NAME(addChannelUnit(_:ingestion:));
/**
* Change the base URL (schema + authority + port only) used to communicate with the backend.
*/
@property(nonatomic, strong) NSString *_Nullable logUrl;
/**
* Set the app secret.
*/
@property(nonatomic, strong) NSString *_Nullable appSecret;
/**
* Set the maximum size of the internal storage. This method must be called before App Center is started.
*
* @discussion The default maximum database size is 10485760 bytes (10 MiB).
*
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
* (default is 4096 bytes). Values below 24576 bytes (24 KiB) will be ignored.
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
* is successful, and `NO` otherwise.
*/
- (void)setMaxStorageSize:(long)sizeInBytes
completionHandler:(nullable void (^)(BOOL))completionHandler NS_SWIFT_NAME(setMaxStorageSize(_:completionHandler:));
/**
* Return a channel unit instance for the given groupId.
*
* @param groupId The group ID for a channel unit.
*
* @return A channel unit instance or `nil`.
*/
- (nullable id<MSACChannelUnitProtocol>)channelUnitForGroupId:(NSString *)groupId;
@end
NS_ASSUME_NONNULL_END
#endif
@@ -1,68 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CHANNEL_PROTOCOL_H
#define MSAC_CHANNEL_PROTOCOL_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACEnable.h>)
#import <AppCenter/MSACEnable.h>
#else
#import "MSACEnable.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@protocol MSACChannelDelegate;
/**
* `MSACChannelProtocol` contains the essential operations of a channel. Channels are broadly responsible for enqueuing logs to be sent to
* the backend and/or stored on disk.
*/
NS_SWIFT_NAME(ChannelProtocol)
@protocol MSACChannelProtocol <NSObject, MSACEnable>
/**
* Add delegate.
*
* @param delegate delegate.
*/
- (void)addDelegate:(id<MSACChannelDelegate>)delegate;
/**
* Remove delegate.
*
* @param delegate delegate.
*/
- (void)removeDelegate:(id<MSACChannelDelegate>)delegate;
/**
* Pause operations, logs will be stored but not sent.
*
* @param identifyingObject Object used to identify the pause request.
*
* @discussion A paused channel doesn't forward logs to the ingestion. The identifying object used to pause the channel can be any unique
* object. The same identifying object must be used to call resume. For simplicity if the caller is the one owning the channel then @c self
* can be used as identifying object.
*
* @see resumeWithIdentifyingObject:
*/
- (void)pauseWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* Resume operations, logs can be sent again.
*
* @param identifyingObject Object used to passed to the pause method.
*
* @discussion The channel only resume when all the outstanding identifying objects have been resumed.
*
* @see pauseWithIdentifyingObject:
*/
- (void)resumeWithIdentifyingObject:(id<NSObject>)identifyingObject;
@end
NS_ASSUME_NONNULL_END
#endif
@@ -1,18 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CONSTANTS_FLAGS_H
#define MSAC_CONSTANTS_FLAGS_H
#import <Foundation/Foundation.h>
typedef NS_OPTIONS(NSUInteger, MSACFlags) {
MSACFlagsNone = (0 << 0), // => 00000000
MSACFlagsNormal = (1 << 0), // => 00000001
MSACFlagsCritical = (1 << 1), // => 00000010
MSACFlagsPersistenceNormal DEPRECATED_MSG_ATTRIBUTE("please use MSACFlagsNormal") = MSACFlagsNormal,
MSACFlagsPersistenceCritical DEPRECATED_MSG_ATTRIBUTE("please use MSACFlagsCritical") = MSACFlagsCritical,
MSACFlagsDefault = MSACFlagsNormal
} NS_SWIFT_NAME(Flags);
#endif
@@ -1,170 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
/**
* Log Levels
*/
typedef NS_ENUM(NSUInteger, MSACLogLevel) {
/**
* Logging will be very chatty
*/
MSACLogLevelVerbose = 2,
/**
* Debug information will be logged
*/
MSACLogLevelDebug = 3,
/**
* Information will be logged
*/
MSACLogLevelInfo = 4,
/**
* Errors and warnings will be logged
*/
MSACLogLevelWarning = 5,
/**
* Errors will be logged
*/
MSACLogLevelError = 6,
/**
* Only critical errors will be logged
*/
MSACLogLevelAssert = 7,
/**
* Logging is disabled
*/
MSACLogLevelNone = 99
} NS_SWIFT_NAME(LogLevel);
typedef NSString * (^MSACLogMessageProvider)(void)NS_SWIFT_NAME(LogMessageProvider);
typedef void (^MSACLogHandler)(MSACLogMessageProvider messageProvider, MSACLogLevel logLevel, NSString *tag, const char *file,
const char *function, uint line) NS_SWIFT_NAME(LogHandler);
/**
* Channel priorities, check the kMSACPriorityCount if you add a new value.
* The order matters here! Values NEED to range from low priority to high priority.
*/
typedef NS_ENUM(NSInteger, MSACPriority) { MSACPriorityBackground, MSACPriorityDefault, MSACPriorityHigh } NS_SWIFT_NAME(Priority);
static short const kMSACPriorityCount = MSACPriorityHigh + 1;
/**
* The priority by which the modules are initialized.
* MSACPriorityMax is reserved for only 1 module and this needs to be Crashes.
* Crashes needs to be initialized first to catch crashes in our other SDK Modules (which will hopefully never happen) and to avoid losing
* any log at crash time.
*/
typedef NS_ENUM(NSInteger, MSACInitializationPriority) {
MSACInitializationPriorityDefault = 500,
MSACInitializationPriorityHigh = 750,
MSACInitializationPriorityMax = 999
} NS_SWIFT_NAME(InitializationPriority);
/**
* Enum with the different HTTP status codes.
*/
typedef NS_ENUM(NSInteger, MSACHTTPCodesNo) {
// Invalid
MSACHTTPCodesNo0XXInvalidUnknown = 0,
// Informational
MSACHTTPCodesNo1XXInformationalUnknown = 1,
MSACHTTPCodesNo100Continue = 100,
MSACHTTPCodesNo101SwitchingProtocols = 101,
MSACHTTPCodesNo102Processing = 102,
// Success
MSACHTTPCodesNo2XXSuccessUnknown = 2,
MSACHTTPCodesNo200OK = 200,
MSACHTTPCodesNo201Created = 201,
MSACHTTPCodesNo202Accepted = 202,
MSACHTTPCodesNo203NonAuthoritativeInformation = 203,
MSACHTTPCodesNo204NoContent = 204,
MSACHTTPCodesNo205ResetContent = 205,
MSACHTTPCodesNo206PartialContent = 206,
MSACHTTPCodesNo207MultiStatus = 207,
MSACHTTPCodesNo208AlreadyReported = 208,
MSACHTTPCodesNo209IMUsed = 209,
// Redirection
MSACHTTPCodesNo3XXSuccessUnknown = 3,
MSACHTTPCodesNo300MultipleChoices = 300,
MSACHTTPCodesNo301MovedPermanently = 301,
MSACHTTPCodesNo302Found = 302,
MSACHTTPCodesNo303SeeOther = 303,
MSACHTTPCodesNo304NotModified = 304,
MSACHTTPCodesNo305UseProxy = 305,
MSACHTTPCodesNo306SwitchProxy = 306,
MSACHTTPCodesNo307TemporaryRedirect = 307,
MSACHTTPCodesNo308PermanentRedirect = 308,
// Client error
MSACHTTPCodesNo4XXSuccessUnknown = 4,
MSACHTTPCodesNo400BadRequest = 400,
MSACHTTPCodesNo401Unauthorised = 401,
MSACHTTPCodesNo402PaymentRequired = 402,
MSACHTTPCodesNo403Forbidden = 403,
MSACHTTPCodesNo404NotFound = 404,
MSACHTTPCodesNo405MethodNotAllowed = 405,
MSACHTTPCodesNo406NotAcceptable = 406,
MSACHTTPCodesNo407ProxyAuthenticationRequired = 407,
MSACHTTPCodesNo408RequestTimeout = 408,
MSACHTTPCodesNo409Conflict = 409,
MSACHTTPCodesNo410Gone = 410,
MSACHTTPCodesNo411LengthRequired = 411,
MSACHTTPCodesNo412PreconditionFailed = 412,
MSACHTTPCodesNo413RequestEntityTooLarge = 413,
MSACHTTPCodesNo414RequestURITooLong = 414,
MSACHTTPCodesNo415UnsupportedMediaType = 415,
MSACHTTPCodesNo416RequestedRangeNotSatisfiable = 416,
MSACHTTPCodesNo417ExpectationFailed = 417,
MSACHTTPCodesNo418IamATeapot = 418,
MSACHTTPCodesNo419AuthenticationTimeout = 419,
MSACHTTPCodesNo420MethodFailureSpringFramework = 420,
MSACHTTPCodesNo420EnhanceYourCalmTwitter = 4200,
MSACHTTPCodesNo422UnprocessableEntity = 422,
MSACHTTPCodesNo423Locked = 423,
MSACHTTPCodesNo424FailedDependency = 424,
MSACHTTPCodesNo424MethodFailureWebDaw = 4240,
MSACHTTPCodesNo425UnorderedCollection = 425,
MSACHTTPCodesNo426UpgradeRequired = 426,
MSACHTTPCodesNo428PreconditionRequired = 428,
MSACHTTPCodesNo429TooManyRequests = 429,
MSACHTTPCodesNo431RequestHeaderFieldsTooLarge = 431,
MSACHTTPCodesNo444NoResponseNginx = 444,
MSACHTTPCodesNo449RetryWithMicrosoft = 449,
MSACHTTPCodesNo450BlockedByWindowsParentalControls = 450,
MSACHTTPCodesNo451RedirectMicrosoft = 451,
MSACHTTPCodesNo451UnavailableForLegalReasons = 4510,
MSACHTTPCodesNo494RequestHeaderTooLargeNginx = 494,
MSACHTTPCodesNo495CertErrorNginx = 495,
MSACHTTPCodesNo496NoCertNginx = 496,
MSACHTTPCodesNo497HTTPToHTTPSNginx = 497,
MSACHTTPCodesNo499ClientClosedRequestNginx = 499,
// Server error
MSACHTTPCodesNo5XXSuccessUnknown = 5,
MSACHTTPCodesNo500InternalServerError = 500,
MSACHTTPCodesNo501NotImplemented = 501,
MSACHTTPCodesNo502BadGateway = 502,
MSACHTTPCodesNo503ServiceUnavailable = 503,
MSACHTTPCodesNo504GatewayTimeout = 504,
MSACHTTPCodesNo505HTTPVersionNotSupported = 505,
MSACHTTPCodesNo506VariantAlsoNegotiates = 506,
MSACHTTPCodesNo507InsufficientStorage = 507,
MSACHTTPCodesNo508LoopDetected = 508,
MSACHTTPCodesNo509BandwidthLimitExceeded = 509,
MSACHTTPCodesNo510NotExtended = 510,
MSACHTTPCodesNo511NetworkAuthenticationRequired = 511,
MSACHTTPCodesNo522ConnectionTimedOut = 522,
MSACHTTPCodesNo598NetworkReadTimeoutErrorUnknown = 598,
MSACHTTPCodesNo599NetworkConnectTimeoutErrorUnknown = 599
} NS_SWIFT_NAME(HTTPCodesNo);
@@ -1,71 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_CUSTOM_PROPERTIES_H
#define MSAC_CUSTOM_PROPERTIES_H
#import <Foundation/Foundation.h>
/**
* Custom properties builder.
* Collects multiple properties to send in one log.
*/
NS_SWIFT_NAME(CustomProperties)
@interface MSACCustomProperties : NSObject
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setString:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setNumber:(NSNumber *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setBool:(BOOL)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Set the specified property value with the specified key.
* If the properties previously contained a property for the key, the old value is replaced.
*
* @param key Key with which the specified value is to be set.
* @param value Value to be set with the specified key.
*
* @return This instance.
*/
- (instancetype)setDate:(NSDate *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
/**
* Clear the property for the specified key.
*
* @param key Key whose mapping is to be cleared.
*
* @return This instance.
*/
- (instancetype)clearPropertyForKey:(NSString *)key NS_SWIFT_NAME(clearProperty(forKey:));
@end
#endif
@@ -1,101 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_DEVICE_H
#define MSAC_DEVICE_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACWrapperSdk.h>)
#import <AppCenter/MSACWrapperSdk.h>
#else
#import "MSACWrapperSdk.h"
#endif
NS_SWIFT_NAME(Device)
@interface MSACDevice : MSACWrapperSdk
/*
* Name of the SDK. Consists of the name of the SDK and the platform, e.g. "appcenter.ios", "appcenter.android"
*/
@property(nonatomic, copy, readonly) NSString *sdkName;
/*
* Version of the SDK in semver format, e.g. "1.2.0" or "0.12.3-alpha.1".
*/
@property(nonatomic, copy, readonly) NSString *sdkVersion;
/*
* Device model (example: iPad2,3).
*/
@property(nonatomic, copy, readonly) NSString *model;
/*
* Device manufacturer (example: HTC).
*/
@property(nonatomic, copy, readonly) NSString *oemName;
/*
* OS name (example: iOS).
*/
@property(nonatomic, copy, readonly) NSString *osName;
/*
* OS version (example: 9.3.0).
*/
@property(nonatomic, copy, readonly) NSString *osVersion;
/*
* OS build code (example: LMY47X). [optional]
*/
@property(nonatomic, copy, readonly) NSString *osBuild;
/*
* API level when applicable like in Android (example: 15). [optional]
*/
@property(nonatomic, copy, readonly) NSNumber *osApiLevel;
/*
* Language code (example: en_US).
*/
@property(nonatomic, copy, readonly) NSString *locale;
/*
* The offset in minutes from UTC for the device time zone, including daylight savings time.
*/
@property(nonatomic, readonly, strong) NSNumber *timeZoneOffset;
/*
* Screen size of the device in pixels (example: 640x480).
*/
@property(nonatomic, copy, readonly) NSString *screenSize;
/*
* Application version name, e.g. 1.1.0
*/
@property(nonatomic, copy, readonly) NSString *appVersion;
/*
* Carrier name (for mobile devices). [optional]
*/
@property(nonatomic, copy, readonly) NSString *carrierName;
/*
* Carrier country code (for mobile devices). [optional]
*/
@property(nonatomic, copy, readonly) NSString *carrierCountry;
/*
* The app's build number, e.g. 42.
*/
@property(nonatomic, copy, readonly) NSString *appBuild;
/*
* The bundle identifier, package identifier, or namespace, depending on what the individual plattforms use, .e.g com.microsoft.example.
* [optional]
*/
@property(nonatomic, copy, readonly) NSString *appNamespace;
@end
#endif
@@ -1,27 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_ENABLE_H
#define MSAC_ENABLE_H
#import <Foundation/Foundation.h>
/**
* Protocol to define an instance that can be enabled/disabled.
*/
NS_SWIFT_NAME(Enable)
@protocol MSACEnable <NSObject>
@required
/**
* Enable/disable this instance and delete data on disabled state.
*
* @param isEnabled A boolean value set to YES to enable the instance or NO to disable it.
* @param deleteData A boolean value set to YES to delete data or NO to keep it.
*/
- (void)setEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deleteData NS_SWIFT_NAME(setEnabled(_:deleteDataOnDisabled:));
@end
#endif
@@ -1,74 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_LOG_H
#define MSAC_LOG_H
#import <Foundation/Foundation.h>
@class MSACDevice;
NS_SWIFT_NAME(Log)
@protocol MSACLog <NSObject>
/**
* Log type.
*/
@property(nonatomic, copy) NSString *type;
/**
* Log timestamp.
*/
@property(nonatomic, strong) NSDate *timestamp;
/**
* A session identifier is used to correlate logs together. A session is an abstract concept in the API and is not necessarily an analytics
* session, it can be used to only track crashes.
*/
@property(nonatomic, copy) NSString *sid;
/**
* Optional distribution group ID value.
*/
@property(nonatomic, copy) NSString *distributionGroupId;
/**
* Optional user identifier.
*/
@property(nonatomic, copy) NSString *userId;
/**
* Device properties associated to this log.
*/
@property(nonatomic, strong) MSACDevice *device;
/**
* Transient object tag. For example, a log can be tagged with a transmission target. We do this currently to prevent properties being
* applied retroactively to previous logs by comparing their tags.
*/
@property(nonatomic, strong) NSObject *tag;
/**
* Checks if the object's values are valid.
*
* @return YES, if the object is valid.
*/
- (BOOL)isValid;
/**
* Adds a transmission target token that this log should be sent to.
*
* @param token The transmission target token.
*/
- (void)addTransmissionTargetToken:(NSString *)token;
/**
* Gets all transmission target tokens that this log should be sent to.
*
* @returns Collection of transmission target tokens that this log should be sent to.
*/
- (NSSet *)transmissionTargetTokens;
@end
#endif
@@ -1,25 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_LOG_WITH_PROPERTIES_H
#define MSAC_LOG_WITH_PROPERTIES_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACAbstractLog.h>)
#import <AppCenter/MSACAbstractLog.h>
#else
#import "MSACAbstractLog.h"
#endif
NS_SWIFT_NAME(LogWithProperties)
@interface MSACLogWithProperties : MSACAbstractLog
/**
* Additional key/value pair parameters. [optional]
*/
@property(nonatomic, strong) NSDictionary<NSString *, NSString *> *properties;
@end
#endif
@@ -1,54 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_LOGGER
#define MSAC_LOGGER
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
#define MSACLog(_level, _tag, _message) \
[MSACLogger logMessage:_message level:_level tag:_tag file:__FILE__ function:__PRETTY_FUNCTION__ line:__LINE__]
#define MSACLogAssert(tag, format, ...) \
MSACLog(MSACLogLevelAssert, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogError(tag, format, ...) \
MSACLog(MSACLogLevelError, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogWarning(tag, format, ...) \
MSACLog(MSACLogLevelWarning, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogInfo(tag, format, ...) \
MSACLog(MSACLogLevelInfo, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogDebug(tag, format, ...) \
MSACLog(MSACLogLevelDebug, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
#define MSACLogVerbose(tag, format, ...) \
MSACLog(MSACLogLevelVerbose, tag, (^{ \
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
}))
NS_SWIFT_NAME(Logger)
@interface MSACLogger : NSObject
+ (void)logMessage:(MSACLogMessageProvider)messageProvider
level:(MSACLogLevel)loglevel
tag:(NSString *)tag
file:(const char *)file
function:(const char *)function
line:(uint)line;
@end
#endif
@@ -1,19 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef SERIALIZABLE_OBJECT_H
#define SERIALIZABLE_OBJECT_H
@protocol MSACSerializableObject <NSCoding>
/**
* Serialize this object to a dictionary.
*
* @return A dictionary representing this object.
*/
- (NSMutableDictionary *)serializeToDictionary;
@end
#endif
@@ -1,23 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_SERVICE_H
#define MSAC_SERVICE_H
#import <Foundation/Foundation.h>
/**
* Protocol declaring service logic.
*/
NS_SWIFT_NAME(Service)
@protocol MSACService <NSObject>
/**
* Indicates whether this service is enabled.
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
@end
#endif
@@ -1,58 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_SERVICE_ABSTRACT_H
#define MSAC_SERVICE_ABSTRACT_H
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACService.h>)
#import <AppCenter/MSACService.h>
#else
#import "MSACService.h"
#endif
@protocol MSACChannelGroupProtocol;
/**
* Abstraction of services common logic.
* This class is intended to be subclassed only not instantiated directly.
*/
NS_SWIFT_NAME(ServiceAbstract)
@interface MSACServiceAbstract : NSObject <MSACService>
/**
* The flag indicates whether the service is started from application or not.
*/
@property(nonatomic, assign) BOOL startedFromApplication;
/**
* Start this service with a channel group. Also sets the flag that indicates that a service has been started.
*
* @param channelGroup channel group used to persist and send logs.
* @param appSecret app secret for the SDK.
* @param token default transmission target token for this service.
* @param fromApplication indicates whether the service started from an application or not.
*/
- (void)startWithChannelGroup:(id<MSACChannelGroupProtocol>)channelGroup
appSecret:(NSString *)appSecret
transmissionTargetToken:(NSString *)token
fromApplication:(BOOL)fromApplication;
/**
* Update configuration when the service requires to start again. This method should only be called if the service is started from libraries
* and then is being started from an application.
*
* @param appSecret app secret for the SDK.
* @param token default transmission target token for this service.
*/
- (void)updateConfigurationWithAppSecret:(NSString *)appSecret transmissionTargetToken:(NSString *)token;
/**
* The flag indicate whether the service needs the application secret or not.
*/
@property(atomic, readonly) BOOL isAppSecretRequired;
@end
#endif
@@ -1,21 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
/**
* This is a utility for producing App Center style log messages. It is only intended for use by App Center services and wrapper SDKs of App
* Center.
*/
NS_SWIFT_NAME(WrapperLogger)
@interface MSACWrapperLogger : NSObject
+ (void)MSACWrapperLog:(MSACLogMessageProvider)message tag:(NSString *)tag level:(MSACLogLevel)level;
@end
@@ -1,60 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_WRAPPER_SDK_H
#define MSAC_WRAPPER_SDK_H
#import <Foundation/Foundation.h>
NS_SWIFT_NAME(WrapperSdk)
@interface MSACWrapperSdk : NSObject
/*
* Version of the wrapper SDK. When the SDK is embedding another base SDK (for example Xamarin.Android wraps Android), the Xamarin specific
* version is populated into this field while sdkVersion refers to the original Android SDK. [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperSdkVersion;
/*
* Name of the wrapper SDK (examples: Xamarin, Cordova). [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperSdkName;
/*
* Version of the wrapper technology framework (Xamarin runtime version or ReactNative or Cordova etc...). [optional]
*/
@property(nonatomic, copy, readonly) NSString *wrapperRuntimeVersion;
/*
* Label that is used to identify application code 'version' released via Live Update beacon running on device.
*/
@property(nonatomic, copy, readonly) NSString *liveUpdateReleaseLabel;
/*
* Identifier of environment that current application release belongs to, deployment key then maps to environment like Production, Staging.
*/
@property(nonatomic, copy, readonly) NSString *liveUpdateDeploymentKey;
/*
* Hash of all files (ReactNative or Cordova) deployed to device via LiveUpdate beacon. Helps identify the Release version on device or need
* to download updates in future
*/
@property(nonatomic, copy, readonly) NSString *liveUpdatePackageHash;
- (instancetype)initWithWrapperSdkVersion:(NSString *)wrapperSdkVersion
wrapperSdkName:(NSString *)wrapperSdkName
wrapperRuntimeVersion:(NSString *)wrapperRuntimeVersion
liveUpdateReleaseLabel:(NSString *)liveUpdateReleaseLabel
liveUpdateDeploymentKey:(NSString *)liveUpdateDeploymentKey
liveUpdatePackageHash:(NSString *)liveUpdatePackageHash;
/**
* Checks if the object's values are valid.
*
* @return YES, if the object is valid.
*/
- (BOOL)isValid;
@end
#endif
@@ -1,12 +0,0 @@
framework module AppCenter {
umbrella header "AppCenter.h"
export *
module * { export * }
link framework "Foundation"
link framework "SystemConfiguration"
link framework "AppKit"
link "sqlite3"
link "z"
}
@@ -1,114 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#import "MSACConstants+Flags.h"
@protocol MSACChannelUnitProtocol;
@protocol MSACChannelGroupProtocol;
@protocol MSACChannelProtocol;
@protocol MSACLog;
NS_ASSUME_NONNULL_BEGIN
@protocol MSACChannelDelegate <NSObject>
@optional
/**
* A callback that is called when a channel unit is added to the channel group.
*
* @param channelGroup The channel group.
* @param channel The newly added channel.
*/
- (void)channelGroup:(id<MSACChannelGroupProtocol>)channelGroup didAddChannelUnit:(id<MSACChannelUnitProtocol>)channel;
/**
* A callback that is called when a log is just enqueued. Delegates may want to prepare the log a little more before further processing.
*
* @param log The log to prepare.
*/
- (void)channel:(id<MSACChannelProtocol>)channel prepareLog:(id<MSACLog>)log;
/**
* A callback that is called after a log is definitely prepared.
*
* @param log The log.
* @param internalId An internal Id to keep track of logs.
* @param flags Options for the log.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didPrepareLog:(id<MSACLog>)log internalId:(NSString *)internalId flags:(MSACFlags)flags;
/**
* A callback that is called after a log completed the enqueueing process whether it was successful or not.
*
* @param log The log.
* @param internalId An internal Id to keep track of logs.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didCompleteEnqueueingLog:(id<MSACLog>)log internalId:(NSString *)internalId;
/**
* Callback method that will be called before each log will be send to the server.
*
* @param channel The channel object.
* @param log The log to be sent.
*/
- (void)channel:(id<MSACChannelProtocol>)channel willSendLog:(id<MSACLog>)log;
/**
* Callback method that will be called in case the SDK was able to send a log.
*
* @param channel The channel object.
* @param log The log to be sent.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didSucceedSendingLog:(id<MSACLog>)log;
/**
* Callback method that will be called in case the SDK was unable to send a log.
*
* @param channel The channel object.
* @param log The log to be sent.
* @param error The error that occured.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didFailSendingLog:(id<MSACLog>)log withError:(nullable NSError *)error;
/**
* A callback that is called when setEnabled has been invoked.
*
* @param channel The channel.
* @param isEnabled The boolean that indicates enabled.
* @param deletedData The boolean that indicates deleting data on disabled.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didSetEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deletedData;
/**
* A callback that is called when pause has been invoked.
*
* @param channel The channel.
* @param identifyingObject The identifying object used to pause the channel.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didPauseWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* A callback that is called when resume has been invoked.
*
* @param channel The channel.
* @param identifyingObject The identifying object used to resume the channel.
*/
- (void)channel:(id<MSACChannelProtocol>)channel didResumeWithIdentifyingObject:(id<NSObject>)identifyingObject;
/**
* Callback method that will determine if a log should be filtered out from the usual processing pipeline. If any delegate returns true, the
* log is filtered.
*
* @param channelUnit The channel unit that is going to send the log.
* @param log The log to be filtered or not.
*
* @return `true` if the log should be filtered out.
*/
- (BOOL)channelUnit:(id<MSACChannelUnitProtocol>)channelUnit shouldFilterLog:(id<MSACLog>)log;
@end
NS_ASSUME_NONNULL_END
@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19H1323</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>AppCenter</string>
<key>CFBundleIdentifier</key>
<string>com.microsoft.appcenter</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AppCenter</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>11C505</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>19B90</string>
<key>DTSDKName</key>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1130</string>
<key>DTXcodeBuild</key>
<string>11C505</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
</dict>
</plist>
@@ -1,44 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACAppCenter.h>)
#import <AppCenter/MSACAbstractLog.h>
#import <AppCenter/MSACAppCenter.h>
#import <AppCenter/MSACAppCenterErrors.h>
#import <AppCenter/MSACChannelGroupProtocol.h>
#import <AppCenter/MSACChannelProtocol.h>
#import <AppCenter/MSACConstants+Flags.h>
#import <AppCenter/MSACConstants.h>
#import <AppCenter/MSACCustomProperties.h>
#import <AppCenter/MSACDevice.h>
#import <AppCenter/MSACEnable.h>
#import <AppCenter/MSACLog.h>
#import <AppCenter/MSACLogWithProperties.h>
#import <AppCenter/MSACLogger.h>
#import <AppCenter/MSACSerializableObject.h>
#import <AppCenter/MSACService.h>
#import <AppCenter/MSACServiceAbstract.h>
#import <AppCenter/MSACWrapperLogger.h>
#import <AppCenter/MSACWrapperSdk.h>
#else
#import "MSACAbstractLog.h"
#import "MSACAppCenter.h"
#import "MSACAppCenterErrors.h"
#import "MSACChannelGroupProtocol.h"
#import "MSACChannelProtocol.h"
#import "MSACConstants+Flags.h"
#import "MSACConstants.h"
#import "MSACCustomProperties.h"
#import "MSACDevice.h"
#import "MSACEnable.h"
#import "MSACLog.h"
#import "MSACLogWithProperties.h"
#import "MSACLogger.h"
#import "MSACSerializableObject.h"
#import "MSACService.h"
#import "MSACServiceAbstract.h"
#import "MSACWrapperLogger.h"
#import "MSACWrapperSdk.h"
#endif
@@ -1,14 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#ifndef MSAC_ABSTRACT_LOG_H
#define MSAC_ABSTRACT_LOG_H
#import <Foundation/Foundation.h>
NS_SWIFT_NAME(AbstractLog)
@interface MSACAbstractLog : NSObject
@end
#endif
@@ -1,203 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_APP_CENTER
#define MSAC_APP_CENTER
#if __has_include(<AppCenter/MSACConstants.h>)
#import <AppCenter/MSACConstants.h>
#else
#import "MSACConstants.h"
#endif
@class MSACWrapperSdk;
#if !TARGET_OS_TV
@class MSACCustomProperties;
#endif
NS_SWIFT_NAME(AppCenter)
@interface MSACAppCenter : NSObject
/**
* Returns the singleton instance of MSACAppCenter.
*/
+ (instancetype)sharedInstance;
/**
* Configure the SDK with an application secret.
*
* @param appSecret A unique and secret key used to identify the application.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configureWithAppSecret:(NSString *)appSecret NS_SWIFT_NAME(configure(withAppSecret:));
/**
* Configure the SDK.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configure;
/**
* Configure the SDK with an application secret and an array of services to start.
*
* @param appSecret A unique and secret key used to identify the application.
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)start:(NSString *)appSecret withServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(withAppSecret:services:));
/**
* Start the SDK with an array of services.
*
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)startWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(services:));
/**
* Start a service.
*
* @param service A service to start.
*
* @discussion This may be called only once per service per application process lifetime.
*/
+ (void)startService:(Class)service;
/**
* Configure the SDK with an array of services to start from a library. This will not start the service at application level, it will enable
* the service only for the library.
*
* @param services Array of services to start.
*/
+ (void)startFromLibraryWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(startFromLibrary(services:));
/**
* The flag indicates whether the SDK has already been configured or not.
*/
@property(class, atomic, readonly, getter=isConfigured) BOOL configured;
/**
* The flag indicates whether app is running in App Center Test Cloud.
*/
@property(class, atomic, readonly, getter=isRunningInAppCenterTestCloud) BOOL runningInAppCenterTestCloud;
/**
* The flag indicates whether or not the SDK was enabled as a whole
*
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
/**
* Flag indicating whether SDK can send network requests.
*
* The state is persisted in the device's storage across application launches.
*/
@property(class, nonatomic, getter=isNetworkRequestsAllowed, setter=setNetworkRequestsAllowed:)
BOOL networkRequestsAllowed NS_SWIFT_NAME(networkRequestsAllowed);
/**
* The SDK's log level.
*/
@property(class, nonatomic) MSACLogLevel logLevel;
/**
* Base URL to use for backend communication.
*/
@property(class, nonatomic, strong) NSString *logUrl;
/**
* Set log handler.
*/
@property(class, nonatomic) MSACLogHandler logHandler;
/**
* Set wrapper SDK information to use when building device properties. This is intended in case you are building a SDK that uses the App
* Center SDK under the hood, e.g. our Xamarin SDK or ReactNative SDk.
*/
@property(class, nonatomic, strong) MSACWrapperSdk *wrapperSdk;
#if !TARGET_OS_TV
/**
* Set the custom properties.
*
* @param customProperties Custom properties object.
*/
+ (void)setCustomProperties:(MSACCustomProperties *)customProperties;
#endif
/**
* Check whether the application delegate forwarder is enabled or not.
*
* @discussion The application delegate forwarder forwards messages that target your application delegate methods via swizzling to the SDK.
* It simplifies the SDK integration but may not be suitable to any situations. For
* instance it should be disabled if you or one of your third party SDK is doing message forwarding on the application delegate. Message
* forwarding usually implies the implementation of @see NSObject#forwardingTargetForSelector: or @see NSObject#forwardInvocation: methods.
* To disable the application delegate forwarder just add the `AppCenterAppDelegateForwarderEnabled` tag to your Info .plist file and set it
* to `0`. Then you will have to forward any application delegate needed by the SDK manually.
*/
@property(class, readonly, nonatomic, getter=isAppDelegateForwarderEnabled) BOOL appDelegateForwarderEnabled;
/**
* Unique installation identifier.
*
*/
@property(class, readonly, nonatomic) NSUUID *installId;
/**
* Detect if a debugger is attached to the app process. This is only invoked once on app startup and can not detect
* if the debugger is being attached during runtime!
*
*/
@property(class, readonly, nonatomic, getter=isDebuggerAttached) BOOL debuggerAttached;
/**
* Current version of AppCenter SDK.
*
*/
@property(class, readonly, nonatomic) NSString *sdkVersion;
/**
* Set the maximum size of the internal storage. This method must be called before App Center is started. This method is only intended for
* applications.
*
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
* (default is 4096 bytes). Values below 20,480 bytes (20 KiB) will be ignored.
*
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
* is successful, and `NO` otherwise. This parameter can be null.
*
* @discussion This only sets the maximum size of the database, but App Center modules might store additional data.
* The value passed to this method is not persisted on disk. The default maximum database size is 10485760 bytes (10 MiB).
*/
+ (void)setMaxStorageSize:(long)sizeInBytes completionHandler:(void (^)(BOOL))completionHandler;
/**
* Set the user identifier.
*
* @discussion Set the user identifier for logs sent for the default target token when the secret passed in @c
* MSACAppCenter:start:withServices: contains "target={targetToken}".
*
* For App Center backend the user identifier maximum length is 256 characters.
*
* AppCenter must be configured or started before this API can be used.
*/
@property(class, nonatomic, strong) NSString *userId;
/**
* Set country code to use when building device properties.
*
* @see https://www.iso.org/obp/ui/#search for more information.
*/
@property(class, nonatomic, strong) NSString *countryCode;
@end
#endif

Some files were not shown because too many files have changed in this diff Show More