-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from GlobalMessageServices/RDGMS-838-implement-…
…user-data-collection-function-in-i-os-sdk Rdgms 838 implement user data collection function in i os sdk
- Loading branch information
Showing
12 changed files
with
217 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+25.3 KB
(140%)
PushSDK.xcworkspace/xcuserdata/o.korniienko.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// InfoManager.swift | ||
// PushSDK | ||
// | ||
// Created by o.korniienko on 19.01.23. | ||
// | ||
|
||
import Foundation | ||
import CoreLocation | ||
|
||
class InfoManager: NSObject, CLLocationManagerDelegate { | ||
|
||
|
||
let locationManager = CLLocationManager() | ||
let geoCoder = CLGeocoder() | ||
|
||
|
||
override init() { | ||
super.init() | ||
locationManager.requestAlwaysAuthorization() | ||
DispatchQueue.global().async { | ||
if CLLocationManager.locationServicesEnabled(){ | ||
self.locationManager.delegate = self | ||
self.locationManager.startMonitoringSignificantLocationChanges() | ||
} | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
static func getLanguageAndRegion()-> LanguageAndRegion{ | ||
let preferLanguage = Locale.preferredLanguages.first ?? "n/a" | ||
|
||
if preferLanguage == "n/a"{ | ||
return LanguageAndRegion(deviceLanguage: "n/a", deviceLanguageEn: "n/a", isoLanguageCode: "n/a", isoRegion: "n/a", region: "n/a", regionEn: "n/a") | ||
} | ||
let locale = NSLocale(localeIdentifier: preferLanguage) | ||
let localeEn = NSLocale(localeIdentifier: "en_EN") | ||
|
||
let language = locale.localizedString(forLanguageCode: locale.languageCode) | ||
let languageEn = localeEn.localizedString(forLanguageCode: locale.languageCode) | ||
let region = locale.localizedString(forCountryCode: locale.countryCode ?? "en") | ||
let regionEn = localeEn.localizedString(forCountryCode: locale.countryCode ?? "en") | ||
|
||
return LanguageAndRegion(deviceLanguage: language ?? "n/a", | ||
deviceLanguageEn: languageEn ?? "n/a", | ||
isoLanguageCode: locale.languageCode, | ||
isoRegion: locale.countryCode ?? "n/a", | ||
region: region ?? "n/a", | ||
regionEn: regionEn ?? "n/a") | ||
} | ||
|
||
|
||
func isLocationServicesEnaled() async ->Bool{ | ||
return CLLocationManager.locationServicesEnabled() | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters