Commit Graph

588 Commits

Author SHA1 Message Date
Michael Kirk 1dd06a5e6c Fix registration flow / Keep push tokens in sync
* Separate registering an account from registering for push notifications
  * Allows us to complete registration without prompting user for
    notification settings.

UX Changes
----------
* Automatically keep push tokens in sync on startup.
  Push tokens *can* change, though they rarely do. It happens more often
  for people switching between appstore/beta builds.

  fixes #1174

* Show alert with registration failure
  * add secret 8-tap debug log gesture to registration flow

* Move registration to separate flow
  * don't see flash of inbox when first launching

* show useful error messages when given wrong code / no code

* remove background fetch
  We werent using it, but only relying on a side effect of it which is
  no longer necessary.

Code Changes
------------

* More registration logging.

* Install PromiseKit with carthage

  Our dependencies are not yet framework compatible, so we can't use
  cocoapods.

* Merge preferences util "category" into superclass.

  The immediate reason for this is Swift interop was assuming optional
  types were not optional, and exploding when a value was nil.

  This is clearer anyway, since we were treating it like a subclass, and
  it was the only thing using the class anyway.

* auto-genstrings now searches *.swift (and *.h, which was previously
  broken) for translateable strings.

// FREEBIE
2016-11-03 16:13:49 -04:00
Michael Kirk f98e57e164 WIP: Fix hanging registration when background modes disabled
fixes #1329

We must register notification settings earlier to be sure we'll be able
to get the users push tokens.

We were previously relying on a quirk of background fetch, a feature
which we don't *actually* use, wherein it's possible to get push tokens
for a user without first prompting them for their notification
settings. More on this from UIApplication.h:

    // Calling this will result in either application:didRegisterForRemoteNotificationsWithDeviceToken: or application:didFailToRegisterForRemoteNotificationsWithError: to be called on the application delegate.
    // ---> Note: these callbacks will be made only if the application has successfully registered for user notifications with registerUserNotificationSettings:, or if it is enabled for Background App Refresh.
    - (void)registerForRemoteNotifications NS_AVAILABLE_IOS(8_0);

In the previous implementation, if a user had disabled background
notifications (e.g.  in order to save battery), we were waiting for push
tokens that would never come.

However, this simple "fix" introduces a UX problem - now we prompt for
an alert in the middle of our registration flow.

// FREEBIE
2016-11-03 16:12:28 -04:00
Michael Kirk bae050480a Debug logging around call init crash.
// FREEBIE
2016-11-03 16:12:27 -04:00
Mike 7c6b84c46b Outgoing message sound respects Settings toggle (#1373) 2016-11-03 14:51:38 -04:00
Michael Kirk 431a91a485 Convert to non-decimal build numbers.
first three digits were redundant anyway. Now it's less likely to mess
up the build version, and yet easier to recover if you do.

// FREEBIE
2016-11-01 11:35:54 -04:00
Michael Kirk 61fa5756ab bump build.
oof: I previously pushed a build number 2.6.4.x to the 2.6.3.x release, so
now we have to stick with 2.6.4 in order to upload it. =/

// FREEBIE
2016-11-01 11:11:01 -04:00
Michael Kirk 21ebe0db98 bump build
// FREEBIE
2016-11-01 10:49:05 -04:00
Michael Kirk 1eb234e8ba Attempt to fix intermittent crash in messages view controller
HACK to work around radar #28167779

  "UICollectionView performBatchUpdates can trigger a crash if the collection view is flagged for layout"
  more: https://github.com/PSPDFKit-labs/radar.apple.com/tree/master/28167779%20-%20CollectionViewBatchingIssue

I have never reproduced the crash, but it's appearing in about 0.05% of
<=2.6.2 sessions and an alarming ~5.0% of beta sessions >=2.6.3.8.

// FREEBIE
2016-11-01 10:05:11 -04:00
Michael Kirk e206afdc5e Bump build
// FREEBIE
2016-10-31 10:39:40 -04:00
Michael Kirk eded20f1f5 [SSK] Don't send empty message to self after changing disappearing timer
previously fixed in: SSK:91fcd01632a81f2aa67d2d94b97c68d519e6881a

But got lost in a rebase after moving TSMessagesManager+sendMessage to
OWSMessageSender.

// FREEBIE
2016-10-28 15:10:31 -04:00
Michael Kirk f2ee006d5f Update translations
Bump version.

// FREEBIE
2016-10-28 10:52:43 -04:00
Michael Kirk 541ca39155 Partial revert of 33f6a95520 (#1421)
An existing related crash is much more common after 33f6a95520.

This is the only change proximate to the crash.

Crash looks like this:

    Last Exception Backtrace:
    0   CoreFoundation                  0x189c601c0 __exceptionPreprocess + 124 (NSException.m:165)
    1   libobjc.A.dylib                 0x18869855c objc_exception_throw + 56 (objc-exception.mm:521)
    2   CoreFoundation                  0x189c60094 +[NSException raise:format:arguments:] + 104 (NSException.m:131)
    3   Foundation                      0x18a6ea82c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112 (NSException.m:157)
    4   UIKit                           0x1903a534c -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:] + 13428 (UICollectionView.m:5585)
    5   UIKit                           0x1903a8e98 -[UICollectionView _endUpdatesWithInvalidationContext:tentativelyForReordering:animator:] + 92 (UICollectionView.m:6401)
    6   UIKit                           0x1903a9178 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:] + 384 (UICollectionView.m:6459)
    7   UIKit                           0x1903a8fd8 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:] + 96 (UICollectionView.m:6423)
    8   UIKit                           0x1903a8f5c -[UICollectionView _performBatchUpdates:completion:invalidationContext:] + 84 (UICollectionView.m:6418)
    9   UIKit                           0x18fc834ec -[UICollectionView performBatchUpdates:completion:] + 64 (UICollectionView.m:6407)
    10  Signal                          0x1000d7e90 -[MessagesViewController yapDatabaseModified:] + 756 (MessagesViewController.m:1863)

// FREEBIE
2016-10-28 09:36:39 -04:00
Matthew Douglass bbfffdf79f Scanning an invalid QR code shows an error dialog
* From the error dialog you are able to back out of scanning or try again. Adds English localization for this message.

  Adds an extra flag in OWSQRCodeScanningViewController to make sure that we don’t handle captureResults when capture is disabled (this was racing before because the call to [capture stop] is async and that was causing the cancel case to present the error dialog multiple times.

  Fixes Signal-iOS#1347

* Fixes appearance of race with starting capture
  Also marks the capture variable as atomic since it is accessed on
  multiple threads.

// FREEBIE
2016-10-26 15:49:19 -04:00
Michael Kirk 40d6550fca Update translations
// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 560b377512 Fix intermittent crash on network status change
These notifications are posted off the main thread, so let's make sure
we're only touching the view hierarchy on the main thread.

// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 66f0f8cc95 [SSK] Better error messages when failing to send
// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 84e5606972 [SSK] Fix disappearing messages don't become consistent after reinstall
Fixes the bug wherein:

Given the sender had disappearing messages enabled
And the receiver thinks it's disabled (this can happen due to re-install)
When we receive a disappearing message
The message does start expiring timer and disappear
But you see a notice "<sender> disabled disappearing messages"
Rather than the expected "<Sender> set disappearing messages timer to X".

// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 689df1be37 Handle key change in group send
// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 0e345dbbad Update translations
// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 33f6a95520 Explain send failures for text and media messages
fixes #1231

Motivation
----------
Previously when messages failed to send, there was no reason given.
Furthermore, when media messages failed to send there was no indication
that any attempt to send the message even occurred, nor a retry
dialog.

UX Changes
----------
- Show "uploading" status for media
- Show specific error message in retry-send dialog
- Only scroll to bottom when new message is inserted
- Show specific errors when group creation fails

Code Changes
-----------
- Updated incorrect references to TSMessageAdapters which were actually
  references to OWSMessageData
- MessageSender was extracted from SSK MessagesManager
- access MessagesManager as property
- idiomatic init/properties for Env
- log contact intersections
- Move scroll-to-bottom animation to main thread.

// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 7c32259a92 We aren't using ErrorMessage/InfoMessage. (#1412)
We incorrectly assumed some parameters were these types, but actually
they were TSMessageAdapters.

// FREEBIE
2016-10-23 13:39:42 -04:00
Matthew Douglass 722c3a5e78 Create TSOutgoingMessage with info on group change
TSOutgoingMessage is created with details about the group changes so that we see more than just “Group Updated.”

* Customizes message for new group creation

  Replaces GROUP_UPDATED with GROUP_CREATED for a brand new group. Localized for English only.

* Updates to use fixed SignalServiceKit branch

// FREEBIE
2016-10-20 20:32:30 -04:00
Michael Kirk 802d2bfdff Revert "Create TSOutgoingMessage with info on group change"
Inadvertently stole credit for work done when squashing the commits.
Reverting and re-merging giving appropriate credit.

This reverts commit 8242c9e381.
2016-10-20 20:31:54 -04:00
Michael Kirk 8242c9e381 Create TSOutgoingMessage with info on group change
TSOutgoingMessage is created with details about the group changes so that we see more than just “Group Updated.”

* Customizes message for new group creation
  Replaces GROUP_UPDATED with GROUP_CREATED for a brand new group. Localized for English only.

* Updates to use fixed SignalServiceKit branch

// FREEBIE
2016-10-20 20:20:41 -04:00
Michael Kirk 15dcbbb06c re-pull translations after updating source
// FREEBIE
2016-10-20 13:27:38 -04:00
Michael Kirk b9945b7e32 pull latest translations before updating source
// FREEBIE
2016-10-20 13:27:38 -04:00
Michael Kirk 16a30f2892 translate untranslated strings
// FREEBIE
2016-10-20 13:27:38 -04:00
Michael Kirk 8c062f93aa Refresh Localizable.strings with auto-genstrings
This shouldn't have any affect on behavior, we're just removing unused
strings, extracting comments, and re ordering.

Going forward we can use auto-genstrings to get a sensible diff without
having to manually add/remove/update strings and comments.

Thanks @nixnuex!

// FREEBIE
2016-10-20 13:27:38 -04:00
Michael Kirk 64f4eb73c5 Allow autogenstrings to find all strings
* Inline #define strings, so genstrings can find them
* Make all strings single line so they don't get truncated by auto-genstrings
* Properly quote LHS in strings file

// FREEBIE
2016-10-20 13:27:38 -04:00
nixnuex 722356db58 script to generate and merge global .strings file
* make auto-genstrings executable
2016-10-20 13:27:38 -04:00
Michael Kirk 49de772997 Fix slow reloading conversation view. (#1397)
Fix animation memory leak exacerbated every time you reload a
conversation with expiration timers.

Stop animation on cells that aren't currently being displayed. This is
relatively minor compared to the above, but still, no reason to waste
cycles.

// FREEBIE
2016-10-15 16:41:40 -04:00
Michael Kirk 50ce283582 Fix empty bubble when setting disappearing message timer in a thread to
yourself.

fixes #1393

// FREEBIE
2016-10-14 19:37:38 -04:00
Michael Kirk 5b01976466 Fix hidden incoming audio
Missed bottom constraint when customizing incoming message bubbles to
include timer icon in footer.

// FREEBIE
2016-10-14 19:10:37 -04:00
Michael Kirk bc9154f18f Bump version / update translations
// FREEBIE
2016-10-14 13:20:10 -04:00
Michael Kirk 1e417ea93f Longpress to copy safety numbers
Nothing else to see here. =)

 ༼ つ ◕◡◕ ༽つ [swift]

// FREEBIE
2016-10-13 10:04:58 -04:00
Michael Kirk da82c01f6e Restart timer animation when returning from background
// FREEBIE
2016-10-13 10:04:58 -04:00
Michael Kirk 04f5c3ce22 Slow the timer animation down a bit.
fixes #1384

// FREEBIE
2016-10-13 10:04:58 -04:00
Michael Kirk 6a4fc3168d Fix delivery shown for undelieverd disappearing messages.
fixes  #1380

// FREEBIE
2016-10-12 14:54:41 -04:00
Michael Kirk ddc8db6ac3 bump build
// FREEBIE
2016-10-12 14:54:41 -04:00
Michael Kirk 607262df6a Remove observers on dealloc (#1379)
// FREEBIE
2016-10-12 12:50:03 -04:00
nixnuex ca5ca9d0cc code verification: show complete phone number 2016-10-12 09:41:42 -04:00
Michael Kirk a04b351455 Fix set timer in group thread. (#1375)
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 7661b7f402 Consistent copy with other platforms
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 185cb24938 Update translations
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 85beb93e86 Style timer changes less alarmingly.
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 89df8ddb31 Group updates can be deleted
Removed some dead code re: NSCopy/Coding, since it seems unused.

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 07ab1bd931 Call notifications appear immediately after call
previously you had to leave/return. This happens because we unregister
observers while our view is not visible.

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 7106eee4a3 Call notifications are deletable
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 405990a7d5 Don't select or copy info message text.
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk dc95d328cb Don't expire messages until they are sent.
// FREEBIE
2016-10-12 09:30:25 -04:00