Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #369 from bitstadium/feature/persian-localization
Browse files Browse the repository at this point in the history
Add persian language file
  • Loading branch information
Benjamin Scholtysik (Reimold) authored Dec 6, 2016
2 parents ffdfac2 + 0576821 commit 69e1374
Show file tree
Hide file tree
Showing 11 changed files with 320 additions and 48 deletions.
36 changes: 20 additions & 16 deletions Classes/BITChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ - (void)persistDataItemQueue {
if (!BITSafeJsonEventsString || strlen(BITSafeJsonEventsString) == 0) {
return;
}

NSData *bundle = [NSData dataWithBytes:BITSafeJsonEventsString length:strlen(BITSafeJsonEventsString)];
[self.persistence persistBundle:bundle];

// Reset both, the async-signal-safe and item counter.
[self resetQueue];
}
Expand All @@ -103,7 +103,7 @@ - (void)enqueueTelemetryItem:(BITTelemetryData *)item {
__weak typeof(self) weakSelf = self;
dispatch_async(self.dataItemsOperations, ^{
typeof(self) strongSelf = weakSelf;

if (strongSelf.isQueueBusy) {
// Case 2: Channel is in blocked state: Trigger sender, start timer to check after again after a while and abort operation.
BITHockeyLogDebug(@"INFO: The channel is saturated. %@ was dropped.", item.debugDescription);
Expand All @@ -116,11 +116,11 @@ - (void)enqueueTelemetryItem:(BITTelemetryData *)item {
// Enqueue item
NSDictionary *dict = [self dictionaryForTelemetryData:item];
[strongSelf appendDictionaryToJsonStream:dict];

if (strongSelf->_dataItemCount >= self.maxBatchSize) {
// Case 3: Max batch count has been reached, so write queue to disk and delete all items.
[strongSelf persistDataItemQueue];

} else if (strongSelf->_dataItemCount == 1) {
// Case 4: It is the first item, let's start the timer.
if (![strongSelf timerIsRunning]) {
Expand All @@ -141,19 +141,19 @@ - (NSDictionary *)dictionaryForTelemetryData:(BITTelemetryData *) telemetryData

- (BITEnvelope *)envelopeForTelemetryData:(BITTelemetryData *)telemetryData {
telemetryData.version = @(BITSchemaVersion);

BITData *data = [BITData new];
data.baseData = telemetryData;
data.baseType = telemetryData.dataTypeName;

BITEnvelope *envelope = [BITEnvelope new];
envelope.time = bit_utcDateString([NSDate date]);
envelope.iKey = _telemetryContext.appIdentifier;

envelope.tags = _telemetryContext.contextDictionary;
envelope.data = data;
envelope.name = telemetryData.envelopeTypeName;

return envelope;
}

Expand All @@ -175,7 +175,7 @@ - (NSString *)serializeDictionaryToJSONString:(NSDictionary *)dictionary {
- (void)appendDictionaryToJsonStream:(NSDictionary *)dictionary {
if (dictionary) {
NSString *string = [self serializeDictionaryToJSONString:dictionary];

// Since we can't persist every event right away, we write it to a simple C string.
// This can then be written to disk by a signal handler in case of a crash.
bit_appendStringToSafeJsonStream(string, &(BITSafeJsonEventsString));
Expand All @@ -191,7 +191,7 @@ void bit_appendStringToSafeJsonStream(NSString *string, char **jsonString) {
if (*jsonString == NULL || strlen(*jsonString) == 0) {
bit_resetSafeJsonStream(jsonString);
}

if (string.length == 0) { return; }

char *new_string = NULL;
Expand Down Expand Up @@ -235,17 +235,21 @@ - (void)startTimer {

self.timerSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self.dataItemsOperations);
dispatch_source_set_timer(self.timerSource, dispatch_walltime(NULL, NSEC_PER_SEC * self.batchInterval), 1ull * NSEC_PER_SEC, 1ull * NSEC_PER_SEC);

__weak typeof(self) weakSelf = self;
dispatch_source_set_event_handler(self.timerSource, ^{
typeof(self) strongSelf = weakSelf;

if (strongSelf->_dataItemCount > 0) {
[strongSelf persistDataItemQueue];
} else {
strongSelf.channelBlocked = NO;
if(strongSelf) {
if (strongSelf->_dataItemCount > 0) {
[strongSelf persistDataItemQueue];
} else {
strongSelf.channelBlocked = NO;
}
[strongSelf invalidateTimer];
}
[strongSelf invalidateTimer];
});

dispatch_resume(self.timerSource);
}

Expand Down
4 changes: 2 additions & 2 deletions HockeySDK-Source.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'HockeySDK-Source'
s.version = '4.1.2'
s.version = '4.1.3'

s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.'
s.description = <<-DESC
Expand All @@ -25,7 +25,7 @@ Pod::Spec.new do |s|
s.frameworks = 'AssetsLibrary', 'CoreGraphics', 'CoreTelephony', 'CoreText', 'MobileCoreServices', 'Photos', 'QuartzCore', 'QuickLook', 'Security', 'SystemConfiguration', 'UIKit'
s.libraries = 'c++', 'z'
s.vendored_frameworks = 'Vendor/CrashReporter.framework'
s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"97\\"" BITHOCKEY_C_BUILD="\\"97\\""} }
s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"97\\"" BITHOCKEY_C_BUILD="\\"98\\""} }
s.resource_bundle = { 'HockeySDKResources' => ['Resources/*.png', 'Resources/*.lproj'] }
s.preserve_paths = 'Resources', 'Support'
s.private_header_files = 'Classes/*Private.h'
Expand Down
2 changes: 1 addition & 1 deletion HockeySDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'HockeySDK'
s.version = '4.1.2'
s.version = '4.1.3'

s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.'
s.description = <<-DESC
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](http://cocoapod-badges.herokuapp.com/v/HockeySDK/badge.png)](http://cocoadocs.org/docsets/HockeySDK)

## Version 4.1.2
## Version 4.1.3

- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.2/docs/docs/Changelog.html)
- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.3/docs/docs/Changelog.html)

**NOTE** If your are using the binary integration of our SDK, make sure that the `HockeySDKResources.bundle` inside the `HockeySDK.embeddedframework`-folder has been added to your application.

### Feedback and iOS 10
**4.1.1 of the HockeySDK removes the Feedback feature from the default version of the SDK.**
**4.1.1 and later of the HockeySDK remove the Feedback feature from the default version of the SDK.**
The reason for this is that iOS 10 requires developers to add a usage string to their Info.plist in case they include the photos framework in their app. If this string is missing, the app will be rejected when submitting the app to the app store. As HockeyApp's Feedback feature includes a dependency to the photos framework. This means that if you include HockeyApp into your app, adding the usage string would be a requirement even for developers who don't use the Feedback feature. If you don't use Feedback in your app, simply upgrade HockeySDK to version 4.1.1 or newer. If you are using Feedback, please have a look at the [Feedback section](#feedback).


Expand Down Expand Up @@ -568,7 +568,7 @@ You should never create your own instance of `BITFeedbackManager` but use the on
[BITHockeyManager sharedHockeyManager].feedbackManager
```

Please check the [documentation](#documentation) of the `BITFeedbackManager` class on more information on how to leverage this feature.
Please check the [documentation](#documentation) of the `BITFeedbackManager` and `BITFeedbackManagerDelegate` classes on more information on how to leverage this feature.

#### 3.8.2 Add the NSPhotoLibraryUsageDescription to your Info.plist.

Expand Down Expand Up @@ -635,7 +635,7 @@ To check if data is send properly to HockeyApp and also see some additional SDK
<a id="documentation"></a>
## 4. Documentation

Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/4.1.2/index.html).
Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/4.1.3/index.html).

<a id="troubleshooting"></a>
## 5.Troubleshooting
Expand All @@ -649,7 +649,7 @@ Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/
Make sure none of the following files are copied into your app bundle, check under app target, `Build Phases`, `Copy Bundle Resources` or in the `.app` bundle after building:

- `HockeySDK.framework` (except if you build a dynamic framework version of the SDK yourself!)
- `de.bitstadium.HockeySDK-iOS-4.1.2.docset`
- `de.bitstadium.HockeySDK-iOS-4.1.3.docset`

### Feature are not working as expected

Expand Down
Loading

0 comments on commit 69e1374

Please sign in to comment.