This file contains hidden or 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
cert = File.read(File.join(RAILS_ROOT, 'config', 'apns-dev.pem')) | |
ctx = OpenSSL::SSL::SSLContext.new | |
ctx.key = OpenSSL::PKey::RSA.new(cert, '') #set passphrase here, if any | |
ctx.cert = OpenSSL::X509::Certificate.new(cert) | |
sock = TCPSocket.new('gateway.sandbox.push.apple.com', 2195) #development gateway | |
ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx) | |
ssl.connect | |
payload = {"aps" => {"alert" => "Oh hai!", "badge" => 1, "sound" => 'default'}} |
This file contains hidden or 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
<?php | |
$apnsHost = 'gateway.sandbox.push.apple.com'; | |
$apnsCert = 'apns-dev.pem'; | |
$apnsPort = 2195; | |
$streamContext = stream_context_create(); | |
stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert); | |
$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext); |
This file contains hidden or 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
NSString *addressString = @"3245 St-Denis, Montreal" | |
SVGeocoder *geocodeRequest = [[SVGeocoder alloc] initWithAddress:addressString]; | |
[geocodeRequest setDelegate:self]; | |
[geocodeRequest startAsynchronous]; |
This file contains hidden or 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
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(45.54181, -73.62928); | |
SVGeocoder *rGeocoderRequest = [[SVGeocoder alloc] initWithCoordinate:coordinate]; | |
[rGeocoderRequest setDelegate:self]; | |
[rGeocoderRequest startAsynchronous]; |
This file contains hidden or 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
- (void)geocoder:(SVGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark; | |
- (void)geocoder:(SVGeocoder *)geocoder didFailWithError:(NSError *)error; |
This file contains hidden or 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
+ (void)show; | |
+ (void)showWithStatus:(NSString*)status; | |
+ (void)showWithStatus:(NSString*)status networkIndicator:(BOOL)show; | |
+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType; | |
+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType networkIndicator:(BOOL)show; | |
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType; | |
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType networkIndicator:(BOOL)show; |
This file contains hidden or 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
+ (void)dismiss; | |
+ (void)dismissWithSuccess:(NSString*)successString; | |
+ (void)dismissWithSuccess:(NSString*)successString afterDelay:(NSTimeInterval)seconds; | |
+ (void)dismissWithError:(NSString*)errorString; | |
+ (void)dismissWithError:(NSString*)errorString afterDelay:(NSTimeInterval)seconds; |
This file contains hidden or 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
[SVHTTPRequest GET:@"http://api.twitter.com/1/users/show.json" | |
parameters:[NSDictionary dictionaryWithObject:@"samvermette" forKey:@"screen_name"] | |
completion:^(NSObject *response) { | |
NSLog(@"%@", response); | |
}]; |
This file contains hidden or 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
+ (void)showWithImage:(UIImage*)image; | |
+ (void)showWithImage:(UIImage*)image status:(NSString*)string; | |
+ (void)showWithImage:(UIImage*)image status:(NSString*)string duration:(NSTimeInterval)duration; |
OlderNewer