Skip to content

Commit

Permalink
v10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Apr 6, 2023
1 parent b151172 commit 3629d64
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 44 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "342"
endingLineNumber = "342"
startingLineNumber = "368"
endingLineNumber = "368"
landmarkName = "-clearSession"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -208,8 +208,8 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "48"
endingLineNumber = "48"
landmarkName = "ImageViewController"
landmarkType = "3">
landmarkName = "buttonClicked(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
Expand Down Expand Up @@ -382,8 +382,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "217"
endingLineNumber = "217"
startingLineNumber = "238"
endingLineNumber = "238"
landmarkName = "-processOpenIdentityAction"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -398,8 +398,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "218"
endingLineNumber = "218"
startingLineNumber = "239"
endingLineNumber = "239"
landmarkName = "-processOpenIdentityAction"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -414,8 +414,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "208"
endingLineNumber = "208"
startingLineNumber = "229"
endingLineNumber = "229"
landmarkName = "-processOpenIdentityAction"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -430,8 +430,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "251"
endingLineNumber = "251"
startingLineNumber = "272"
endingLineNumber = "272"
landmarkName = "-sessionUpgradeWithDataNeeded:"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -446,8 +446,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "271"
endingLineNumber = "271"
startingLineNumber = "296"
endingLineNumber = "296"
landmarkName = "-sessionUpgradeWithDataNeeded:"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -462,8 +462,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "272"
endingLineNumber = "272"
startingLineNumber = "297"
endingLineNumber = "297"
landmarkName = "-sessionUpgradeWithDataNeeded:"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -478,8 +478,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "92"
endingLineNumber = "92"
startingLineNumber = "105"
endingLineNumber = "105"
landmarkName = "-startSessionWith:"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -494,8 +494,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "226"
endingLineNumber = "226"
startingLineNumber = "247"
endingLineNumber = "247"
landmarkName = "-processOpenIdentityAction"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -510,8 +510,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "232"
endingLineNumber = "232"
startingLineNumber = "253"
endingLineNumber = "253"
landmarkName = "-processOpenIdentityAction"
landmarkType = "7">
</BreakpointContent>
Expand Down Expand Up @@ -798,8 +798,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "195"
endingLineNumber = "195"
startingLineNumber = "216"
endingLineNumber = "216"
landmarkName = "-processOpenIdentityAction"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -814,8 +814,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "401"
endingLineNumber = "401"
startingLineNumber = "427"
endingLineNumber = "427"
landmarkName = "-sessionDataNumberItemNeedsUpgrade:compareTo:"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -830,8 +830,8 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "275"
endingLineNumber = "275"
startingLineNumber = "300"
endingLineNumber = "300"
landmarkName = "-sessionUpgradeWithDataNeeded:"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -846,57 +846,73 @@
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "279"
endingLineNumber = "279"
startingLineNumber = "304"
endingLineNumber = "304"
landmarkName = "-sessionUpgradeWithDataNeeded:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "FB57E132-A9BD-4B62-BC58-A5DDF63A5766"
uuid = "CC509A03-F6B9-4BD7-BCB1-D690ABE16838"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "172"
endingLineNumber = "172"
landmarkName = "-processOpenIdentityAction"
startingLineNumber = "381"
endingLineNumber = "381"
landmarkName = "-sessionCustomDataItemNeedsUpgrade:compareTo:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "295EF922-C043-4AA7-8C29-DCB2A826C8C2"
uuid = "E578F586-477A-47BB-8A3A-9CC547844C7C"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "166"
endingLineNumber = "166"
landmarkName = "-processOpenIdentityAction"
startingLineNumber = "116"
endingLineNumber = "116"
landmarkName = "-identifySessionWith:andData:andUserHash:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "CC509A03-F6B9-4BD7-BCB1-D690ABE16838"
uuid = "AFC137EE-A044-4DF2-9282-4F3B04224E91"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "355"
endingLineNumber = "355"
landmarkName = "-sessionCustomDataItemNeedsUpgrade:compareTo:"
startingLineNumber = "276"
endingLineNumber = "276"
landmarkName = "-sessionUpgradeWithDataNeeded:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "42B0AEE2-9584-4031-B9B3-C9A68C336C80"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Sources/ObjCSources/GleapSessionHelper.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "318"
endingLineNumber = "318"
landmarkName = "-updateLocalSessionWith:andCompletion:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
Expand Down
4 changes: 3 additions & 1 deletion Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, GleapDelegate {

Gleap.setApiUrl("http://localhost:9000")
Gleap.setFrameUrl("http://localhost:3001/appnew.html")
Gleap.initialize(withToken: "DUPaIr7s689BBblcFI4pc5aBgYJTm7Sc")
Gleap.initialize(withToken: "KProDXhMS0V3UUku2iNnrZ4XsBnAYzxt")

Gleap.showFeedbackButton(true)

Gleap.sharedInstance().delegate = self

Gleap.trackEvent("asfasdfasdf")

Gleap.setLanguage("de")

// Attach custom data sample.
Gleap.attachCustomData(["value": "Unicorn", "type": "Demo", "ExtraInfo": ["Age": "28", "City": "San Francisco"]])

Expand Down
2 changes: 1 addition & 1 deletion Gleap.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "Gleap"
s.version = "9.0.4"
s.version = "10.0.0"
s.summary = "In-App Bug Reporting and Testing for Apps. Learn more at https://gleap.io"
s.homepage = "https://gleap.io"
s.license = { :type => 'Commercial', :file => 'LICENSE.md' }
Expand Down
1 change: 1 addition & 0 deletions Sources/ObjCSources/GleapSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, retain, nullable) NSString* name;
@property (nonatomic, retain, nullable) NSString* email;
@property (nonatomic, retain, nullable) NSString* phone;
@property (nonatomic, retain, nullable) NSString* lang;
@property (nonatomic, retain, nullable) NSDictionary* customData;
@property (nonatomic, retain, nullable) NSNumber* value;

Expand Down
23 changes: 23 additions & 0 deletions Sources/ObjCSources/GleapSessionHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import "GleapNotificationHelper.h"
#import "GleapCore.h"
#import "GleapEventLogHelper.h"
#import "GleapTranslationHelper.h"

@implementation GleapSessionHelper

Expand Down Expand Up @@ -63,6 +64,18 @@ - (void)startSessionWith:(void (^)(bool success))completion {
[request setValue: gleapId forHTTPHeaderField: @"Gleap-Id"];
[request setValue: gleapHash forHTTPHeaderField: @"Gleap-Hash"];
}

NSString *lang = [GleapTranslationHelper sharedInstance].language;
if (lang != nil) {
NSError *error;
NSData *jsonBodyData = [NSJSONSerialization dataWithJSONObject: @{
@"lang": lang
} options:kNilOptions error: &error];
if (error == nil) {
[request setHTTPBody: jsonBodyData];
}
}

NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:config
delegate:nil
Expand Down Expand Up @@ -159,6 +172,11 @@ - (void)processOpenIdentityAction {
[sessionRequestData setValue: userHash forKey: @"userHash"];
}

NSString *lang = [GleapTranslationHelper sharedInstance].language;
if (lang != nil) {
[sessionRequestData setValue: lang forKey: @"lang"];
}

@try {
if (data != nil && data.customData != nil && [[data.customData allKeys] count] > 0) {
[sessionRequestData addEntriesFromDictionary: data.customData];
Expand Down Expand Up @@ -255,6 +273,10 @@ - (BOOL)sessionUpgradeWithDataNeeded:(NSDictionary *)newData {
return YES;
}

if ([self sessionDataItemNeedsUpgrade: self.currentSession.lang compareTo: [newData objectForKey: @"lang"]]) {
return YES;
}

if ([self sessionDataItemNeedsUpgrade: self.currentSession.name compareTo: [newData objectForKey: @"name"]]) {
return YES;
}
Expand Down Expand Up @@ -307,6 +329,7 @@ - (void)updateLocalSessionWith:(NSDictionary *)data andCompletion:(void (^)(bool
gleapSession.phone = [data objectForKey: @"phone"];
gleapSession.name = [data objectForKey: @"name"];
gleapSession.value = [data objectForKey: @"value"];
gleapSession.lang = [data objectForKey: @"lang"];
} @catch (id exp) {

}
Expand Down

0 comments on commit 3629d64

Please sign in to comment.